]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/repack.c: keep track of existing packs unconditionally
authorTaylor Blau <me@ttaylorr.com>
Wed, 29 Sep 2021 01:55:10 +0000 (21:55 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 Sep 2021 04:20:56 +0000 (21:20 -0700)
commit90f838bc368d0a3495fb4164dd76e505bf761b29
treec0427886aeb9abb255050a3f0415f38e0134b7c9
parent08944d1c221a7f4fe42a50c0f11f129769edc9b1
builtin/repack.c: keep track of existing packs unconditionally

In order to be able to write a multi-pack index during repacking, `git
repack` must keep track of which packs it wants to write into the MIDX.
This set is the union of existing packs which will not be deleted,
new pack(s) generated as a result of the repack, and .keep packs.

Prior to this patch, `git repack` populated the list of existing packs
only when repacking all-into-one (i.e., with `-A` or `-a`), but we will
soon need to know this list when repacking when writing a MIDX without
a-i-o.

Populate the list of existing packs unconditionally, and guard removing
packs from that list only when repacking a-i-o.

Additionally, keep track of filenames of kept packs separately, since
this, too, will be used in an upcoming patch.

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