]> git.ipfire.org Git - thirdparty/git.git/commitdiff
midx: remove now-unused linked list of multi-pack indices
authorPatrick Steinhardt <ps@pks.im>
Tue, 15 Jul 2025 11:29:24 +0000 (13:29 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Jul 2025 19:07:30 +0000 (12:07 -0700)
In the preceding commits we have migrated all users of the linked list
of multi-pack indices to instead use those stored in the object database
sources. Remove those now-unused pointers.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx.c
midx.h
odb.h
packfile.c

diff --git a/midx.c b/midx.c
index 472d6bf17ab922b4c0cf6eabc489600953a422f1..7d407682e60a6f4adbd9f760f37c73a59a2712a4 100644 (file)
--- a/midx.c
+++ b/midx.c
@@ -726,7 +726,6 @@ int midx_preferred_pack(struct multi_pack_index *m, uint32_t *pack_int_id)
 int prepare_multi_pack_index_one(struct odb_source *source, int local)
 {
        struct repository *r = source->odb->repo;
-       struct multi_pack_index *m;
 
        prepare_repo_settings(r);
        if (!r->settings.core_multi_pack_index)
@@ -735,21 +734,9 @@ int prepare_multi_pack_index_one(struct odb_source *source, int local)
        if (source->midx)
                return 1;
 
-       m = load_multi_pack_index(r, source->path, local);
-       if (m) {
-               struct multi_pack_index *mp = r->objects->multi_pack_index;
-               if (mp) {
-                       m->next = mp->next;
-                       mp->next = m;
-               } else {
-                       r->objects->multi_pack_index = m;
-               }
-               source->midx = m;
+       source->midx = load_multi_pack_index(r, source->path, local);
 
-               return 1;
-       }
-
-       return 0;
+       return !!source->midx;
 }
 
 int midx_checksum_valid(struct multi_pack_index *m)
@@ -842,7 +829,6 @@ void clear_midx_file(struct repository *r)
                                close_midx(source->midx);
                        source->midx = NULL;
                }
-               r->objects->multi_pack_index = NULL;
        }
 
        if (remove_path(midx.buf))
diff --git a/midx.h b/midx.h
index 639a6f50e45d958f6c4be6c5977786546a497d05..076382de8acd26c25c179c03b01994daa15bd711 100644 (file)
--- a/midx.h
+++ b/midx.h
@@ -35,8 +35,6 @@ struct odb_source;
        "GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL"
 
 struct multi_pack_index {
-       struct multi_pack_index *next;
-
        const unsigned char *data;
        size_t data_len;
 
diff --git a/odb.h b/odb.h
index f09dba1fe1dd3ae708852c2355939e25e0b247b6..09177bf430dc38591a619baf864c0aff2eac0de6 100644 (file)
--- a/odb.h
+++ b/odb.h
@@ -123,13 +123,6 @@ struct object_database {
        struct commit_graph *commit_graph;
        unsigned commit_graph_attempted : 1; /* if loading has been attempted */
 
-       /*
-        * private data
-        *
-        * should only be accessed directly by packfile.c and midx.c
-        */
-       struct multi_pack_index *multi_pack_index;
-
        /*
         * private data
         *
index ff33692f4b599617b813ca7d629ccdaa16b04c16..5d73932f50ce6854d695e92d049c6a6c0a1421a7 100644 (file)
@@ -375,7 +375,6 @@ void close_object_store(struct object_database *o)
                        close_midx(source->midx);
                source->midx = NULL;
        }
-       o->multi_pack_index = NULL;
 
        close_commit_graph(o);
 }