diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index 1b96b4045b..b120a2d79a 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -213,6 +213,25 @@ test_expect_success 'tag with incorrect tag name & missing tagger' ' grep "expected .tagger. line" out ' +test_expect_success 'tag with bad tagger' ' + sha=$(git rev-parse HEAD) && + cat >wrong-tag <<-EOF && + object $sha + type commit + tag not-quite-wrong + tagger Bad Tagger Name + + This is an invalid tag. + EOF + + tag=$(git hash-object --literally -t tag -w --stdin .git/refs/tags/wrong && + test_when_finished "git update-ref -d refs/tags/wrong" && + test_must_fail git fsck --tags 2>out && + grep "error in tag .*: invalid author/committer" out +' + test_expect_success 'cleaned up' ' git fsck >actual 2>&1 && test_cmp empty actual