]> git.ipfire.org Git - thirdparty/git.git/commit
midx-write.c: check count of packs to repack after grouping
authorTaylor Blau <me@ttaylorr.com>
Mon, 1 Apr 2024 21:16:41 +0000 (17:16 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Apr 2024 21:18:17 +0000 (14:18 -0700)
commit440e470edb183d020d2982d90d27113f05189727
treeb549047e8b63117e6f81b81d1e8be25d600f8a56
parente94be606f3153b486a4dd761762353658f72c978
midx-write.c: check count of packs to repack after grouping

In both fill_included_packs_all() and fill_included_packs_batch(), we
accumulate a list of packs whose contents we want to repack together,
and then use that information to feed a list of objects as input to
pack-objects.

In both cases, the `fill_included_packs_` functions keep track of how
many packs they want to repack together, and only execute pack-objects
if there are at least two packs that need repacking.

Having both of these functions keep track of this information themselves
is not strictly necessary, since they also log which packs to repack via
the `include_pack` array, so we can simply count the non-zero entries in
that array after either function is done executing, reducing the overall
amount of code necessary.

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