Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-10-05 23:30:36 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-09 01:45:14 +0300
commite879295b208caffe03ce08d789bd81626b12c208 (patch)
tree8c066a84a03ab4931681449de636c62328a836a3 /t/t1006-cat-file.sh
parent225bc32a989d7a22fa6addafd4ce7dcd04675dbf (diff)
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>
Diffstat (limited to 't/t1006-cat-file.sh')
-rwxr-xr-xt/t1006-cat-file.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh
index 18b3779ccb..c77db35728 100755
--- a/t/t1006-cat-file.sh
+++ b/t/t1006-cat-file.sh
@@ -331,6 +331,11 @@ test_expect_success "Size of broken object is correct" '
git cat-file -s --allow-unknown-type $bogus_sha1 >actual &&
test_cmp expect actual
'
+
+test_expect_success 'clean up broken object' '
+ rm .git/objects/$(test_oid_to_path $bogus_sha1)
+'
+
bogus_type="abcdefghijklmnopqrstuvwxyz1234679"
bogus_content="bogus"
bogus_size=$(strlen "$bogus_content")
@@ -348,6 +353,10 @@ test_expect_success "Size of large broken object is correct when type is large"
test_cmp expect actual
'
+test_expect_success 'clean up broken object' '
+ rm .git/objects/$(test_oid_to_path $bogus_sha1)
+'
+
# Tests for git cat-file --follow-symlinks
test_expect_success 'prep for symlink tests' '
echo_without_newline "$hello_content" >morx &&