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 <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed Jun 16, 2022 at 13:13 UTC 9aa1cba01a90a82dc798cc6d2f18074335f24d2e
1 file changed +3 -1
t/t5329-pack-objects-cruft.sh
+3 -1
@@ -451,11 +451,13 @@ test_expect_success 'expiring cruft objects with git gc' '
451 sort <reachable.raw >reachable &&
452 comm -13 reachable objects >unreachable &&
453
454 - git repack --cruft -d &&
454 + # Write a cruft pack containing all unreachable objects.
455 + git gc --cruft --prune="01-01-1980" &&
456
457 mtimes=$(ls .git/objects/pack/pack-*.mtimes) &&
458 test_path_is_file $mtimes &&
459
460 + # Prune all unreachable objects from the cruft pack.
461 git gc --cruft --prune=now &&
462
463 git cat-file --batch-all-objects --batch-check="%(objectname)" >objects &&