]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/repack.c: store existing cruft packs separately
authorTaylor Blau <me@ttaylorr.com>
Wed, 13 Sep 2023 19:17:57 +0000 (15:17 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Sep 2023 19:32:48 +0000 (12:32 -0700)
commiteabfaf8e8db27dd76ec1f1d4e0a2a124374475ab
treeb4957702c512cbdae5ac644991895fc5d47ff6bb
parent4bbfb003c06c9a3b8e02d8957f053ce938c3d93e
builtin/repack.c: store existing cruft packs separately

When repacking with the `--write-midx` option, we invoke the function
`midx_included_packs()` in order to produce the list of packs we want to
include in the resulting MIDX.

This list is comprised of:

  - existing .keep packs
  - any pack(s) which were written earlier in the same process
  - any unchanged packs when doing a `--geometric` repack
  - any cruft packs

Prior to this patch, we stored pre-existing cruft and non-cruft packs
together (provided those packs are non-kept). This meant we needed an
additional bit to indicate which non-kept pack(s) were cruft versus
those that aren't.

But alternatively we can store cruft packs in a separate list, avoiding
the need for this extra bit, and simplifying the code below.

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