From: Junio C Hamano Date: Fri, 28 Oct 2022 18:26:54 +0000 (-0700) Subject: Merge branch 'tb/remove-unused-pack-bitmap' X-Git-Tag: v2.39.0-rc0~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c5dd7773e138d4b41074d4c6a193651cc187ec1d;p=thirdparty%2Fgit.git Merge branch 'tb/remove-unused-pack-bitmap' When creating a multi-pack bitmap, remove per-pack bitmap files unconditionally as they will never be consulted. * tb/remove-unused-pack-bitmap: builtin/repack.c: remove redundant pack-based bitmaps --- c5dd7773e138d4b41074d4c6a193651cc187ec1d diff --cc t/t7700-repack.sh index df8e94d7a8,2d0e9448dd..10e4e9663b --- a/t/t7700-repack.sh +++ b/t/t7700-repack.sh @@@ -426,30 -426,27 +426,51 @@@ test_expect_success '--write-midx -b pa ) ' + test_expect_success '--write-midx removes stale pack-based bitmaps' ' + rm -fr repo && + git init repo && + test_when_finished "rm -fr repo" && + ( + cd repo && + test_commit base && + GIT_TEST_MULTI_PACK_INDEX=0 git repack -Ab && + + pack_bitmap=$(ls $objdir/pack/pack-*.bitmap) && + test_path_is_file "$pack_bitmap" && + + test_commit tip && + GIT_TEST_MULTI_PACK_INDEX=0 git repack -bm && + + test_path_is_file $midx && + test_path_is_file $midx-$(midx_checksum $objdir).bitmap && + test_path_is_missing $pack_bitmap + ) + ' + +test_expect_success '--write-midx with --pack-kept-objects' ' + git init repo && + test_when_finished "rm -fr repo" && + ( + cd repo && + + test_commit one && + test_commit two && + + one="$(echo "one" | git pack-objects --revs $objdir/pack/pack)" && + two="$(echo "one..two" | git pack-objects --revs $objdir/pack/pack)" && + + keep="$objdir/pack/pack-$one.keep" && + touch "$keep" && + + git repack --write-midx --write-bitmap-index --geometric=2 -d \ + --pack-kept-objects && + + test_path_is_file $keep && + test_path_is_file $midx && + test_path_is_file $midx-$(midx_checksum $objdir).bitmap + ) +' + test_expect_success TTY '--quiet disables progress' ' test_terminal env GIT_PROGRESS_DELAY=0 \ git -C midx repack -ad --quiet --write-midx 2>stderr &&