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

Jeff King committed Oct 5, 2021 at 16:30 UTC e879295b208caffe03ce08d789bd81626b12c208
1 file changed +9
t/t1006-cat-file.sh
+9
@@ -331,6 +331,11 @@ test_expect_success "Size of broken object is correct" '
331 git cat-file -s --allow-unknown-type $bogus_sha1 >actual &&
332 test_cmp expect actual
333 '
334 +
335 +test_expect_success 'clean up broken object' '
336 + rm .git/objects/$(test_oid_to_path $bogus_sha1)
337 +'
338 +
339 bogus_type="abcdefghijklmnopqrstuvwxyz1234679"
340 bogus_content="bogus"
341 bogus_size=$(strlen "$bogus_content")
@@ -348,6 +353,10 @@ test_expect_success "Size of large broken object is correct when type is large"
353 test_cmp expect actual
354 '
355
356 +test_expect_success 'clean up broken object' '
357 + rm .git/objects/$(test_oid_to_path $bogus_sha1)
358 +'
359 +
360 # Tests for git cat-file --follow-symlinks
361 test_expect_success 'prep for symlink tests' '
362 echo_without_newline "$hello_content" >morx &&