> diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh > index 423c0a475f..237ee6e5fc 100755 > --- a/t/t5310-pack-bitmaps.sh > +++ b/t/t5310-pack-bitmaps.sh > @@ -331,4 +331,17 @@ test_expect_success 'pack reuse respects --incremental' ' > git show-index <empty.idx >actual && > test_cmp expect actual > ' > + > +test_expect_success 'truncated bitmap fails gracefully' ' > + git repack -ad && > + git rev-list --use-bitmap-index --count --all >expect && > + bitmap=$(ls .git/objects/pack/*.bitmap) && I think the 'ls' is unnecessary and this would do: bitmap=.git/objects/pack/*.bitmap > + test_when_finished "rm -f $bitmap" && > + head -c 512 <$bitmap >$bitmap.tmp && > + mv $bitmap.tmp $bitmap && > + git rev-list --use-bitmap-index --count --all >actual 2>stderr && > + test_cmp expect actual && > + test_i18ngrep corrupt stderr > +' > + > test_done > -- > 2.18.0.rc2.534.g53d976aeb8 > >