]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/repack.c
builtin/repack.c: remove redundant pack-based bitmaps
authorTaylor Blau <me@ttaylorr.com>
Tue, 18 Oct 2022 02:45:12 +0000 (22:45 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Oct 2022 04:26:16 +0000 (21:26 -0700)
commit55d902cd61a8fd2e9b9aa4bf49b47e4dbf10ea67
tree00cf2b80e37119273c4c75e4e76eba1d10147287
parent3dcec76d9df911ed8321007b1d197c1a206dc164
builtin/repack.c: remove redundant pack-based bitmaps

When we write a MIDX bitmap after repacking, it is possible that the
repository would be left in a state with both pack- and multi-pack
reachability bitmaps.

This can occur, for instance, if a pack that was kept (either by having
a .keep file, or during a geometric repack in which it is not rolled up)
has a bitmap file, and the repack wrote a multi-pack index and bitmap.

When loading a reachability bitmap for the repository, the multi-pack
one is always preferred, so the pack-based one is redundant. Let's
remove it unconditionally, even if '-d' isn't passed, since there is no
practical reason to keep both around. The patch below does just that.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/repack.c
t/t7700-repack.sh