diff --git a/tests/functional/git/packed-refs-no-cache.sh b/tests/functional/git/packed-refs-no-cache.sh index 0f39da775..54e0ab901 100644 --- a/tests/functional/git/packed-refs-no-cache.sh +++ b/tests/functional/git/packed-refs-no-cache.sh @@ -1,5 +1,16 @@ #!/usr/bin/env bash +# Please see https://github.com/NixOS/nix/issues/13457 +# for a higher description of the purpose of the test. +# tl;dr;fetchGit will utilize the git cache and avoid refetching when possible. +# It relies on the presence of either the commit when rev is provided +# or checks if the ref refs/heads/ if ref is provided. +# +# Unfortunately, git can occasionally "pack references" which moves the references +# from individual files to a single unifies file. +# When this occurs, nix can no longer check for the presence of the ref to check +# for the mtime and will refetch unnecessarily. + source ../common.sh requireGit @@ -67,4 +78,4 @@ if [[ -e "$store_path/hello_again" ]]; then else echo "PASS: New commit was not fetched due to caching (as expected)." exit 1 -fi \ No newline at end of file +fi