t/t6501-freshen-objects.sh: prepare for `gc --cruft` by default
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>
Taylor Blau committed
Apr 18, 2023 at 16:40 UTC
b31d45b8315adc49b729496f3c0ed18a41ca08f6
1 file changed
+5
-5
t/t6501-freshen-objects.sh
+5
-5
@@ -101,7 +101,7 @@ do
101
'
102
103
test_expect_success "simultaneous gc ($title)" '
104
- git gc --prune=12.hours.ago
104
+ git gc --no-cruft --prune=12.hours.ago
105
'
106
107
test_expect_success "finish writing out commit ($title)" '
@@ -131,7 +131,7 @@ do
131
'
132
133
test_expect_success "simultaneous gc ($title)" '
134
- git gc --prune=12.hours.ago
134
+ git gc --no-cruft --prune=12.hours.ago
135
'
136
137
# tree should have been refreshed by write-tree
@@ -151,7 +151,7 @@ test_expect_success 'do not complain about existing broken links (commit)' '
151
some message
152
EOF
153
commit=$(git hash-object -t commit -w broken-commit) &&
154
- git gc -q 2>stderr &&
154
+ git gc --no-cruft -q 2>stderr &&
155
verbose git cat-file -e $commit &&
156
test_must_be_empty stderr
157
'
@@ -161,7 +161,7 @@ test_expect_success 'do not complain about existing broken links (tree)' '
161
100644 blob $(test_oid 003) foo
162
EOF
163
tree=$(git mktree --missing <broken-tree) &&
164
- git gc -q 2>stderr &&
164
+ git gc --no-cruft -q 2>stderr &&
165
git cat-file -e $tree &&
166
test_must_be_empty stderr
167
'
@@ -176,7 +176,7 @@ test_expect_success 'do not complain about existing broken links (tag)' '
176
this is a broken tag
177
EOF
178
tag=$(git hash-object -t tag -w broken-tag) &&
179
- git gc -q 2>stderr &&
179
+ git gc --no-cruft -q 2>stderr &&
180
git cat-file -e $tag &&
181
test_must_be_empty stderr
182
'