]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'tb/reverse-midx'
authorJunio C Hamano <gitster@pobox.com>
Wed, 28 Jul 2021 20:18:04 +0000 (13:18 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Jul 2021 20:18:04 +0000 (13:18 -0700)
The code that gives an error message in "git multi-pack-index" when
no subcommand is given tried to print a NULL pointer as a strong,
which has been corrected.

* tb/reverse-midx:
  multi-pack-index: fix potential segfault without sub-command

1  2 
t/t5319-multi-pack-index.sh

index 7609f1ea6416f4e39d62a45e5da26a2427411be3,dab7123b3a2edb3ffc1aaa72d486c92d9fed5ab7..3d4d9f10c31b2ff1a0c5bb21458a3ef54113802f
@@@ -410,19 -410,6 +410,19 @@@ test_expect_success 'git-fsck incorrec
                "git -c core.multipackindex=true fsck"
  '
  
 +test_expect_success 'corrupt MIDX is not reused' '
 +      corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\377" $objdir \
 +              "incorrect object offset" &&
 +      git multi-pack-index write 2>err &&
 +      test_i18ngrep checksum.mismatch err &&
 +      git multi-pack-index verify
 +'
 +
 +test_expect_success 'verify incorrect checksum' '
 +      pos=$(($(wc -c <$objdir/pack/multi-pack-index) - 1)) &&
 +      corrupt_midx_and_verify $pos "\377" $objdir "incorrect checksum"
 +'
 +
  test_expect_success 'repack progress off for redirected stderr' '
        GIT_PROGRESS_DELAY=0 git multi-pack-index --object-dir=$objdir repack 2>err &&
        test_line_count = 0 err
@@@ -837,4 -824,9 +837,9 @@@ test_expect_success 'load reverse inde
        )
  '
  
+ test_expect_success 'usage shown without sub-command' '
+       test_expect_code 129 git multi-pack-index 2>err &&
+       ! test_i18ngrep "unrecognized subcommand" err
+ '
  test_done