]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/t6501-freshen-objects.sh: prepare for `gc --cruft` by default
authorTaylor Blau <me@ttaylorr.com>
Tue, 18 Apr 2023 20:40:43 +0000 (16:40 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Apr 2023 21:56:47 +0000 (14:56 -0700)
In a similar spirit as previous commits, prepare for `gc --cruft`
becoming the default by ensuring that the tests in t6501 explicitly
cover the case of freshening loose objects not using cruft packs.

We could run this test twice, once with `--cruft` and once with
`--no-cruft`, but doing so is unnecessary, since we already test object
rescuing, freshening, and dealing with corrupt parts of the unreachable
object graph extensively via t5329.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t6501-freshen-objects.sh

index 3968b47ed53b7e55eab26fdf8e34aa1472a1bf78..dbfa8a4d4c22b717450fb8d073c6835616d6d556 100755 (executable)
@@ -101,7 +101,7 @@ do
        '
 
        test_expect_success "simultaneous gc ($title)" '
-               git gc --prune=12.hours.ago
+               git gc --no-cruft --prune=12.hours.ago
        '
 
        test_expect_success "finish writing out commit ($title)" '
@@ -131,7 +131,7 @@ do
        '
 
        test_expect_success "simultaneous gc ($title)" '
-               git gc --prune=12.hours.ago
+               git gc --no-cruft --prune=12.hours.ago
        '
 
        # tree should have been refreshed by write-tree
@@ -151,7 +151,7 @@ test_expect_success 'do not complain about existing broken links (commit)' '
        some message
        EOF
        commit=$(git hash-object -t commit -w broken-commit) &&
-       git gc -q 2>stderr &&
+       git gc --no-cruft -q 2>stderr &&
        verbose git cat-file -e $commit &&
        test_must_be_empty stderr
 '
@@ -161,7 +161,7 @@ test_expect_success 'do not complain about existing broken links (tree)' '
        100644 blob $(test_oid 003)     foo
        EOF
        tree=$(git mktree --missing <broken-tree) &&
-       git gc -q 2>stderr &&
+       git gc --no-cruft -q 2>stderr &&
        git cat-file -e $tree &&
        test_must_be_empty stderr
 '
@@ -176,7 +176,7 @@ test_expect_success 'do not complain about existing broken links (tag)' '
        this is a broken tag
        EOF
        tag=$(git hash-object -t tag -w broken-tag) &&
-       git gc -q 2>stderr &&
+       git gc --no-cruft -q 2>stderr &&
        git cat-file -e $tag &&
        test_must_be_empty stderr
 '