diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-09-27 01:39:44 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-27 01:39:44 +0400 |
commit | f190737f225638addbc6695ef27eb926f31bd4e4 (patch) | |
tree | 3143c36f469962c559388387d490b77459f806a1 /t/t1450-fsck.sh | |
parent | 868440f5466c9b3cb6ea188ede95c0c488db7aff (diff) | |
parent | b659605da66ffd513ae60e767495899507e8dfcb (diff) |
Merge branch 'jc/hash-object-fsck-tag'
Using "hash-object --literally", test one of the new breakages
js/fsck-tag-validation topic teaches "fsck" to catch is caught.
* jc/hash-object-fsck-tag:
t1450: make sure fsck detects a malformed tagger line
Diffstat (limited to 't/t1450-fsck.sh')
-rwxr-xr-x | t/t1450-fsck.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index c23408ec07..019fddd4e8 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -233,6 +233,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 <wrong-tag) && + test_when_finished "remove_object $tag" && + echo $tag >.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 |