From: Patrick Steinhardt Date: Thu, 2 Nov 2023 08:47:10 +0000 (+0100) Subject: t7900: assert the absence of refs via git-for-each-ref(1) X-Git-Tag: v2.44.0-rc0~150^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=170ba45acf4db996a58ce849e6901a65c13b94d6;p=thirdparty%2Fgit.git t7900: assert the absence of refs via git-for-each-ref(1) We're asserting that a prefetch of remotes via git-maintenance(1) doesn't write any references in refs/remotes by validating that the directory ".git/refs/remotes" is missing. This is quite roundabout: we don't care about the directory existing, we care about the references not existing, and the way these are stored is on the behest of the reference database. Convert the test to instead check via git-for-each-ref(1) whether any remote reference exist. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index e56f5980dc..cefecee732 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -157,7 +157,8 @@ test_expect_success 'prefetch multiple remotes' ' fetchargs="--prefetch --prune --no-tags --no-write-fetch-head --recurse-submodules=no --quiet" && test_subcommand git fetch remote1 $fetchargs actual && + test_must_be_empty actual && git log prefetch/remotes/remote1/one && git log prefetch/remotes/remote2/two && git fetch --all &&