]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7900: assert the absence of refs via git-for-each-ref(1)
authorPatrick Steinhardt <ps@pks.im>
Thu, 2 Nov 2023 08:47:10 +0000 (09:47 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Nov 2023 23:37:07 +0000 (08:37 +0900)
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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7900-maintenance.sh

index e56f5980dc488ef969dad56560003916daf84829..cefecee732fa3d6b49e3be1266eba1cdb03debdf 100755 (executable)
@@ -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 <run-prefetch.txt &&
        test_subcommand git fetch remote2 $fetchargs <run-prefetch.txt &&
-       test_path_is_missing .git/refs/remotes &&
+       git for-each-ref refs/remotes >actual &&
+       test_must_be_empty actual &&
        git log prefetch/remotes/remote1/one &&
        git log prefetch/remotes/remote2/two &&
        git fetch --all &&