From 16c159d75af29b1929af0e2f341d26fce4e1d546 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 4 Sep 2013 05:01:53 -0400 Subject: [PATCH] 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 --- t/t5308-pack-detect-duplicates.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/t/t5308-pack-detect-duplicates.sh b/t/t5308-pack-detect-duplicates.sh index 04fe242410..9c5a8766ab 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