diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-09-27 01:39:43 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-27 01:39:43 +0400 |
commit | 13f4f046929de00a8c16171c5e08cdcae887b54d (patch) | |
tree | 44af90db2087ad26f7ecb7c2ad0007a503a3bc40 /t/t1450-fsck.sh | |
parent | 9bc4222746a09d57998903dab0361b1d7adc271f (diff) | |
parent | f99b7af661f89865f918e52223a3bdaf312a0de0 (diff) |
Merge branch 'js/fsck-tag-validation'
Teach "git fsck" to inspect the contents of annotated tag objects.
* js/fsck-tag-validation:
Make sure that index-pack --strict checks tag objects
Add regression tests for stricter tag fsck'ing
fsck: check tag objects' headers
Make sure fsck_commit_buffer() does not run out of the buffer
fsck_object(): allow passing object data separately from the object itself
Refactor type_from_string() to allow continuing after detecting an error
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 b52397afd3..c23408ec07 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -214,6 +214,25 @@ test_expect_success 'tag pointing to something else than its type' ' test_must_fail git fsck --tags ' +test_expect_success 'tag with incorrect tag name & missing tagger' ' + sha=$(git rev-parse HEAD) && + cat >wrong-tag <<-EOF && + object $sha + type commit + tag wrong name format + + This is an invalid tag. + EOF + + tag=$(git hash-object -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" && + git fsck --tags 2>out && + grep "invalid .tag. name" out && + grep "expected .tagger. line" out +' + test_expect_success 'cleaned up' ' git fsck >actual 2>&1 && test_cmp empty actual |