Skip to content

Commit f95661b

Browse files
hanwengitster
authored andcommitted
t6500: use "ls -1" to snapshot ref database state
By doing ls -1 .git/{reftable,refs/heads}, we can capture changes to both reftable and packed/loose ref storage. This relies on the fact that git-pack-refs (which we're looking for here) changes the number (loose/packed storage) and/or names (reftable) files used for ref storage. Signed-off-by: Han-Wen Nienhuys <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2cf9f0f commit f95661b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

t/t6500-gc.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ test_expect_success 'background auto gc respects lock for all operations' '
241241
242242
# create a ref whose loose presence we can use to detect a pack-refs run
243243
git update-ref refs/heads/should-be-loose HEAD &&
244-
test_path_is_file .git/refs/heads/should-be-loose &&
244+
(ls -1 .git/refs/heads .git/reftable >expect || true) &&
245245
246246
# now fake a concurrent gc that holds the lock; we can use our
247247
# shell pid so that it looks valid.
@@ -258,7 +258,8 @@ test_expect_success 'background auto gc respects lock for all operations' '
258258
259259
# our gc should exit zero without doing anything
260260
run_and_wait_for_auto_gc &&
261-
test_path_is_file .git/refs/heads/should-be-loose
261+
(ls -1 .git/refs/heads .git/reftable >actual || true) &&
262+
test_cmp expect actual
262263
'
263264

264265
# DO NOT leave a detached auto gc process running near the end of the

0 commit comments

Comments
 (0)