From eddc1f556cd031d59b044ab655cdc591c6180e21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 17 Jun 2021 12:42:00 +0200 Subject: [PATCH] mktag tests: test update-ref and reachable fsck MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Extend the mktag tests to pass the created bad tag through update-ref and fsck. The reason for passing it through update-ref is to guard against it having a segfault as for-each-ref did before c6854508808 (ref-filter: fix NULL check for parse object failure, 2021-04-01). Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- t/t3800-mktag.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh index 78c6f64e36..67f6ecbe88 100755 --- a/t/t3800-mktag.sh +++ b/t/t3800-mktag.sh @@ -44,11 +44,13 @@ check_verify_failure () { ' test_expect_success "setup: $subject" ' + tag_ref=refs/tags/bad_tag && + # Reset any leftover state from the last $subject rm -rf bad-tag && git init --bare bad-tag && - git -C bad-tag hash-object -t tag -w --stdin --literally "bad-tag/$tag_ref" && + + # Unlike fsck-ing unreachable content above, this + # will always fail. + test_must_fail git -C bad-tag fsck + ' } test_expect_mktag_success() { -- 2.39.5