Skip to content

Commit

Permalink
Merge branch 'jc/hash-object-fsck-tag'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Sep 26, 2014
2 parents 868440f + b659605 commit f190737
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions t/t1450-fsck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f190737

Please sign in to comment.