Skip to content

Commit 9aa1cba

Browse files
derrickstoleegitster
authored andcommitted
t5329: test 'git gc --cruft' without '--prune=now'
Replace a 'git repack --cruft -d' with the wrapper 'git gc --cruft' to exercise some logic in builtin/gc.c that adds the '--cruft' option to the underlying 'git repack' command. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 624b8cf commit 9aa1cba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

t/t5329-pack-objects-cruft.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,13 @@ test_expect_success 'expiring cruft objects with git gc' '
451451
sort <reachable.raw >reachable &&
452452
comm -13 reachable objects >unreachable &&
453453
454-
git repack --cruft -d &&
454+
# Write a cruft pack containing all unreachable objects.
455+
git gc --cruft --prune="01-01-1980" &&
455456
456457
mtimes=$(ls .git/objects/pack/pack-*.mtimes) &&
457458
test_path_is_file $mtimes &&
458459
460+
# Prune all unreachable objects from the cruft pack.
459461
git gc --cruft --prune=now &&
460462
461463
git cat-file --batch-all-objects --batch-check="%(objectname)" >objects &&

0 commit comments

Comments
 (0)