midx.c: avoid cruft packs with non-zero repack --batch-size

Apply similar treatment with respect to cruft packs as in a few commits
ago to `repack` with a non-zero `--batch-size`.

Since the case of a non-zero `--batch-size` is handled separately (in
`fill_included_packs_batch()` instead of `fill_included_packs_all()`), a
separate fix must be applied for this case.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Taylor Blau
2022-09-19 21:55:56 -04:00
committed by Junio C Hamano
parent 0a8e561492
commit b62ad5681f
2 changed files with 43 additions and 0 deletions

2
midx.c
View File

@ -1946,6 +1946,8 @@ static int fill_included_packs_batch(struct repository *r,
continue;
if (!pack_kept_objects && p->pack_keep)
continue;
if (p->is_cruft)
continue;
if (open_pack_index(p) || !p->num_objects)
continue;