From: Junio C Hamano Date: Mon, 22 Dec 2014 20:27:41 +0000 (-0800) Subject: Merge branch 'js/fsck-tag-validation' X-Git-Tag: v2.3.0-rc0~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1cb4b3d380fe42a837adfb68126a312f605680f8;p=thirdparty%2Fgit.git Merge branch 'js/fsck-tag-validation' New tag object format validation added in 2.2 showed garbage after a tagname it reported in its error message. * js/fsck-tag-validation: index-pack: terminate object buffers with NUL fsck: properly bound "invalid tag name" error message --- 1cb4b3d380fe42a837adfb68126a312f605680f8 diff --cc t/t1450-fsck.sh index d00b70f99d,7850607783..1f04b8aa3f --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@@ -229,29 -209,14 +229,33 @@@ test_expect_success 'tag with incorrec echo $tag >.git/refs/tags/wrong && test_when_finished "git update-ref -d refs/tags/wrong" && git fsck --tags 2>out && - grep "invalid .tag. name" out && - grep "expected .tagger. line" out + + cat >expect <<-EOF && + warning in tag $tag: invalid '\''tag'\'' name: wrong name format + warning in tag $tag: invalid format - expected '\''tagger'\'' line + EOF + test_cmp expect 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