pack-bitmap-write: rebuild using new bitmap when remapping
commit0e4747ec8b5558e7106146fd37501649f577bcfa
authorChristian Couder <christian.couder@gmail.com>
Mon, 2 Oct 2023 16:55:00 +0000 (2 18:55 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Oct 2023 21:54:30 +0000 (2 14:54 -0700)
tree35327a9a1f160ede807c56ea76b35dcc737ceeb0
parentbe315e9a3fe070af60821f01c2bc508457d2c1b2
pack-bitmap-write: rebuild using new bitmap when remapping

`git repack` is about to learn a new `--filter=<filter-spec>` option and
we will want to check that this option is incompatible with
`--write-bitmap-index`.

Unfortunately it appears that a test like:

test_expect_success '--filter fails with --write-bitmap-index' '
       test_must_fail \
               env GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
               git -C bare.git repack -a -d --write-bitmap-index --filter=blob:none
'

sometimes fail because when rebuilding bitmaps, it appears that we are
reusing existing bitmap information. So instead of detecting that some
objects are missing and erroring out as it should, the
`git repack --write-bitmap-index --filter=...` command succeeds.

Let's fix that by making sure we rebuild bitmaps using new bitmaps
instead of existing ones.

Helped-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap-write.c