packtmp);
/* End of pack replacement. */
- if (delete_redundant && pack_everything & ALL_INTO_ONE) {
+ if (delete_redundant) {
if (write_midx == REPACK_WRITE_MIDX_INCREMENTAL)
existing_packs_retain_midx_packs(&existing, &geometry);
- existing_packs_mark_for_deletion(&existing, &names);
+ if (geometry.split_factor && !combine_cruft_below_size)
+ existing_packs_retain_all_cruft(&existing);
+ if (pack_everything & ALL_INTO_ONE || geometry.split_factor)
+ existing_packs_mark_for_deletion(&existing, &names);
}
if (write_midx != REPACK_WRITE_MIDX_NONE) {
existing_packs_remove_redundant(&existing, packdir,
wrote_incremental_midx);
- if (geometry.split_factor)
- pack_geometry_remove_redundant(&geometry, &names,
- &existing, packdir,
- wrote_incremental_midx);
if (show_progress)
opts |= PRUNE_PACKED_VERBOSE;
prune_packed_objects(opts);
return item;
}
+void existing_packs_retain_all_cruft(struct existing_packs *existing)
+{
+ struct string_list_item *item;
+
+ for_each_string_list_item(item, &existing->cruft_packs)
+ existing_packs_mark_retained(item);
+}
+
void existing_packs_retain_cruft(struct existing_packs *existing,
struct packed_git *cruft)
{
const struct string_list *extra_keep);
int existing_packs_has_non_kept(const struct existing_packs *existing);
int existing_pack_is_marked_for_deletion(struct string_list_item *item);
+void existing_packs_retain_all_cruft(struct existing_packs *existing);
void existing_packs_retain_cruft(struct existing_packs *existing,
struct packed_git *cruft);
void existing_packs_retain_from_geometry(struct existing_packs *existing,