]> git.ipfire.org Git - thirdparty/git.git/commitdiff
repack-geometry: drop unused redundant-pack removal
authorTaylor Blau <me@ttaylorr.com>
Fri, 26 Jun 2026 19:02:30 +0000 (15:02 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Jun 2026 21:54:55 +0000 (14:54 -0700)
The previous commit stopped using pack_geometry_remove_redundant() when
deleting packs after a geometric repack. The existing_packs machinery now
handles the same removal after geometric packs are marked for deletion.

Remove the unused geometry-specific helper and its declaration.

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

index 2064683dcfe1e1de66758bf73130bb1bf0701b31..c75fa50861292f0911b8aa7c488c71fa7c2a7f05 100644 (file)
@@ -245,50 +245,6 @@ struct packed_git *pack_geometry_preferred_pack(struct pack_geometry *geometry)
        return NULL;
 }
 
-static void remove_redundant_packs(struct packed_git **pack,
-                                  uint32_t pack_nr,
-                                  struct string_list *names,
-                                  struct existing_packs *existing,
-                                  const char *packdir,
-                                  bool wrote_incremental_midx)
-{
-       const struct git_hash_algo *algop = existing->repo->hash_algo;
-       struct strbuf buf = STRBUF_INIT;
-       uint32_t i;
-
-       for (i = 0; i < pack_nr; i++) {
-               struct packed_git *p = pack[i];
-               if (string_list_has_string(names, hash_to_hex_algop(p->hash,
-                                                                   algop)))
-                       continue;
-
-               strbuf_reset(&buf);
-               strbuf_addstr(&buf, pack_basename(p));
-               strbuf_strip_suffix(&buf, ".pack");
-
-               if ((p->pack_keep) ||
-                   (string_list_has_string(&existing->kept_packs, buf.buf)))
-                       continue;
-
-               repack_remove_redundant_pack(existing->repo, packdir, buf.buf,
-                                            wrote_incremental_midx);
-       }
-
-       strbuf_release(&buf);
-}
-
-void pack_geometry_remove_redundant(struct pack_geometry *geometry,
-                                   struct string_list *names,
-                                   struct existing_packs *existing,
-                                   const char *packdir,
-                                   bool wrote_incremental_midx)
-{
-       remove_redundant_packs(geometry->pack, geometry->split,
-                              names, existing, packdir, wrote_incremental_midx);
-       remove_redundant_packs(geometry->promisor_pack, geometry->promisor_split,
-                              names, existing, packdir, wrote_incremental_midx);
-}
-
 void pack_geometry_release(struct pack_geometry *geometry)
 {
        if (!geometry)
index 90c89630ef808a43a8bca7bf9d7e9925bd48f493..4295829cea0a611b18fe761f34623c9113a1af73 100644 (file)
--- a/repack.h
+++ b/repack.h
@@ -134,11 +134,6 @@ void pack_geometry_init(struct pack_geometry *geometry,
                        const struct pack_objects_args *args);
 void pack_geometry_split(struct pack_geometry *geometry);
 struct packed_git *pack_geometry_preferred_pack(struct pack_geometry *geometry);
-void pack_geometry_remove_redundant(struct pack_geometry *geometry,
-                                   struct string_list *names,
-                                   struct existing_packs *existing,
-                                   const char *packdir,
-                                   bool wrote_incremental_midx);
 void pack_geometry_release(struct pack_geometry *geometry);
 
 struct tempfile;