Taylor Blau <me@xxxxxxxxxxxx> writes: > 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. It does make the logic at the caller simpler to follow. > - if (batch_size) { > - if (fill_included_packs_batch(r, m, include_pack, batch_size)) > - goto cleanup; > - } else if (fill_included_packs_all(r, m, include_pack)) > + if (batch_size) > + fill_included_packs_batch(r, m, include_pack, batch_size); > + else > + fill_included_packs_all(r, m, include_pack); > + > + for (i = 0; i < m->num_packs; i++) { > + if (include_pack[i]) > + packs_to_repack++; > + } > + if (packs_to_repack <= 1) > goto cleanup; > > repo_config_get_bool(r, "repack.usedeltabaseoffset", &delta_base_offset); Queued. Thanks.