]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/repack.c: extract structure to store existing packs
authorTaylor Blau <me@ttaylorr.com>
Wed, 13 Sep 2023 19:17:35 +0000 (15:17 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Sep 2023 19:32:47 +0000 (12:32 -0700)
commite2b43831a5e4b482be19746d2257a309b51ba5fe
tree588bd4ea66563a036763cfaacb5d7dc0f03d6f63
parent1fc548b2d6a3596f3e1c1f8b1930d8dbd1e30bf3
builtin/repack.c: extract structure to store existing packs

The repack machinery needs to keep track of which packfiles were present
in the repository at the beginning of a repack, segmented by whether or
not each pack is marked as kept.

The names of these packs are stored in two `string_list`s, corresponding
to kept- and non-kept packs, respectively. As a consequence, many
functions within the repack code need to take both `string_list`s as
arguments, leading to code like this:

    ret = write_cruft_pack(&cruft_po_args, packtmp, pack_prefix,
                           cruft_expiration, &names,
                           &existing_nonkept_packs, /* <- */
                           &existing_kept_packs);   /* <- */

Wrap up this pair of `string_list`s into a single structure that stores
both. This saves us from having to pass both string lists separately,
and prepares for adding additional fields to this structure.

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