Skip to content

Commit e879295

Browse files
peffgitster
authored andcommitted
t1006: clean up broken objects
A few of the tests create intentionally broken objects with broken types. Let's clean them up after we're done with them, so that later tests don't get confused (we hadn't noticed because this only affects tests which use --batch-all-objects, but I'm about to add more). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 225bc32 commit e879295

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

t/t1006-cat-file.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,11 @@ test_expect_success "Size of broken object is correct" '
331331
git cat-file -s --allow-unknown-type $bogus_sha1 >actual &&
332332
test_cmp expect actual
333333
'
334+
335+
test_expect_success 'clean up broken object' '
336+
rm .git/objects/$(test_oid_to_path $bogus_sha1)
337+
'
338+
334339
bogus_type="abcdefghijklmnopqrstuvwxyz1234679"
335340
bogus_content="bogus"
336341
bogus_size=$(strlen "$bogus_content")
@@ -348,6 +353,10 @@ test_expect_success "Size of large broken object is correct when type is large"
348353
test_cmp expect actual
349354
'
350355

356+
test_expect_success 'clean up broken object' '
357+
rm .git/objects/$(test_oid_to_path $bogus_sha1)
358+
'
359+
351360
# Tests for git cat-file --follow-symlinks
352361
test_expect_success 'prep for symlink tests' '
353362
echo_without_newline "$hello_content" >morx &&

0 commit comments

Comments
 (0)