From: Jeff King Date: Wed, 4 Sep 2013 09:01:53 +0000 (-0400) Subject: t5308: check that index-pack --strict detects duplicate objects X-Git-Tag: v1.8.5-rc0~115^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=16c159d75af29b1929af0e2f341d26fce4e1d546;p=git-core%2Fgit.git t5308: check that index-pack --strict detects duplicate objects Commit 68be2fea (receive-pack, fetch-pack: reject bogus pack that records objects twice, 2011-11-16) taught index-pack to notice and reject duplicate objects if --strict is given (which it is for incoming packs, if transfer.fsckObjects is set). However, it never tested the code, because we did not have an easy way of generating such a bogus pack. Now that we have test infrastructure to handle this, let's confirm that it works. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/t/t5308-pack-detect-duplicates.sh b/t/t5308-pack-detect-duplicates.sh index 04fe24241..9c5a8766a 100755 --- a/t/t5308-pack-detect-duplicates.sh +++ b/t/t5308-pack-detect-duplicates.sh @@ -70,4 +70,11 @@ test_expect_success 'lookup in duplicated pack (GIT_USE_LOOKUP)' ' test_cmp expect actual ' +test_expect_success 'index-pack can reject packs with duplicates' ' + clear_packs && + create_pack dups.pack 2 && + test_must_fail git index-pack --strict --stdin