From: Johannes Schindelin Date: Fri, 12 Sep 2014 08:08:16 +0000 (+0200) Subject: Make sure that index-pack --strict checks tag objects X-Git-Tag: v2.2.0-rc0~89^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f99b7af661f89865f918e52223a3bdaf312a0de0;p=thirdparty%2Fgit.git Make sure that index-pack --strict checks tag objects One of the most important use cases for the strict tag object checking is when transfer.fsckobjects is set to true to catch invalid objects early on. This new regression test essentially tests the same code path by directly calling 'index-pack --strict' on a pack containing an tag object without a 'tagger' line. Technically, this test is not enough: it only exercises a code path that *warns*, not one that *fails*. The reason is that hash-object and pack-objects both insist on parsing the tag objects and would fail on invalid tag objects at this time. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh index 4bbb718751..61bc8da560 100755 --- a/t/t5302-pack-index.sh +++ b/t/t5302-pack-index.sh @@ -243,4 +243,23 @@ test_expect_success 'running index-pack in the object store' ' test -f .git/objects/pack/pack-${pack1}.idx ' +test_expect_success 'index-pack --strict warns upon missing tagger in tag' ' + sha=$(git rev-parse HEAD) && + cat >wrong-tag <err && + grep "^error:.* expected .tagger. line" err +' + test_done