From 0c32b0c8c32b558f6b2c3782172181ba2f2c3558 Mon Sep 17 00:00:00 2001 From: Farid Zakaria Date: Fri, 11 Jul 2025 15:57:27 -0700 Subject: [PATCH] Added comment to test case --- tests/functional/git/packed-refs-no-cache.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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