]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5329: test 'git gc --cruft' without '--prune=now'
authorDerrick Stolee <derrickstolee@github.com>
Thu, 16 Jun 2022 13:13:48 +0000 (13:13 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Jun 2022 18:59:55 +0000 (11:59 -0700)
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>
t/t5329-pack-objects-cruft.sh

index b481224b93decdaa106b11d5a27f79659ee05ee0..8968f7a08d8700bb22aec956e3f8e50ab2f376bd 100755 (executable)
@@ -451,11 +451,13 @@ test_expect_success 'expiring cruft objects with git gc' '
                sort <reachable.raw >reachable &&
                comm -13 reachable objects >unreachable &&
 
-               git repack --cruft -d &&
+               # Write a cruft pack containing all unreachable objects.
+               git gc --cruft --prune="01-01-1980" &&
 
                mtimes=$(ls .git/objects/pack/pack-*.mtimes) &&
                test_path_is_file $mtimes &&
 
+               # Prune all unreachable objects from the cruft pack.
                git gc --cruft --prune=now &&
 
                git cat-file --batch-all-objects --batch-check="%(objectname)" >objects &&