Skip to content

Commit 170ba45

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 390c5b0 commit 170ba45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

t/t7900-maintenance.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ test_expect_success 'prefetch multiple remotes' '
157157
fetchargs="--prefetch --prune --no-tags --no-write-fetch-head --recurse-submodules=no --quiet" &&
158158
test_subcommand git fetch remote1 $fetchargs <run-prefetch.txt &&
159159
test_subcommand git fetch remote2 $fetchargs <run-prefetch.txt &&
160-
test_path_is_missing .git/refs/remotes &&
160+
git for-each-ref refs/remotes >actual &&
161+
test_must_be_empty actual &&
161162
git log prefetch/remotes/remote1/one &&
162163
git log prefetch/remotes/remote2/two &&
163164
git fetch --all &&

0 commit comments

Comments
 (0)