diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2018-09-13 18:02:27 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-17 20:49:41 (GMT) |
commit | 66ec0390e75406aa9f9295577052b9ec06d3a169 (patch) | |
tree | 10ac7957629a11cb4dff8d14db35f74c78e21fc0 /t/t5319-multi-pack-index.sh | |
parent | 144d70333e826ea2480d60eb2298013eeef0cabf (diff) | |
download | git-66ec0390e75406aa9f9295577052b9ec06d3a169.zip git-66ec0390e75406aa9f9295577052b9ec06d3a169.tar.gz git-66ec0390e75406aa9f9295577052b9ec06d3a169.tar.bz2 |
fsck: verify multi-pack-index
When core.multiPackIndex is true, we may have a multi-pack-index
in our object directory. Add calls to 'git multi-pack-index verify'
at the end of 'git fsck' if so.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5319-multi-pack-index.sh')
-rwxr-xr-x | t/t5319-multi-pack-index.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh index 828c240..bd8e841 100755 --- a/t/t5319-multi-pack-index.sh +++ b/t/t5319-multi-pack-index.sh @@ -160,12 +160,17 @@ corrupt_midx_and_verify() { DATA="${2:-\0}" && OBJDIR=$3 && GREPSTR="$4" && + COMMAND="$5" && + if test -z "$COMMAND" + then + COMMAND="git multi-pack-index verify --object-dir=$OBJDIR" + fi && FILE=$OBJDIR/pack/multi-pack-index && chmod a+w $FILE && test_when_finished mv midx-backup $FILE && cp $FILE midx-backup && printf "$DATA" | dd of="$FILE" bs=1 seek="$POS" conv=notrunc && - test_must_fail git multi-pack-index verify --object-dir=$OBJDIR 2>test_err && + test_must_fail $COMMAND 2>test_err && grep -v "^+" test_err >err && test_i18ngrep "$GREPSTR" err } @@ -258,6 +263,12 @@ test_expect_success 'verify incorrect offset' ' "incorrect object offset" ' +test_expect_success 'git-fsck incorrect offset' ' + corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\07" $objdir \ + "incorrect object offset" \ + "git -c core.multipackindex=true fsck" +' + test_expect_success 'repack removes multi-pack-index' ' test_path_is_file $objdir/pack/multi-pack-index && git repack -adf && |