midx: remove now-unused linked list of multi-pack indices

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>

Patrick Steinhardt committed Jul 15, 2025 at 13:29 UTC ec865d94d4615c00fbf9ac50f4274b1d3fbf73a6
4 files changed +2 -26
midx.c
+2 -16
@@ -726,7 +726,6 @@ int midx_preferred_pack(struct multi_pack_index *m, uint32_t *pack_int_id)
726 int prepare_multi_pack_index_one(struct odb_source *source, int local)
727 {
728 struct repository *r = source->odb->repo;
729 - struct multi_pack_index *m;
729
730 prepare_repo_settings(r);
731 if (!r->settings.core_multi_pack_index)
@@ -735,21 +734,9 @@ int prepare_multi_pack_index_one(struct odb_source *source, int local)
734 if (source->midx)
735 return 1;
736
738 - m = load_multi_pack_index(r, source->path, local);
739 - if (m) {
740 - struct multi_pack_index *mp = r->objects->multi_pack_index;
741 - if (mp) {
742 - m->next = mp->next;
743 - mp->next = m;
744 - } else {
745 - r->objects->multi_pack_index = m;
746 - }
747 - source->midx = m;
737 + source->midx = load_multi_pack_index(r, source->path, local);
738
749 - return 1;
750 - }
751 -
752 - return 0;
739 + return !!source->midx;
740 }
741
742 int midx_checksum_valid(struct multi_pack_index *m)
@@ -842,7 +829,6 @@ void clear_midx_file(struct repository *r)
829 close_midx(source->midx);
830 source->midx = NULL;
831 }
845 - r->objects->multi_pack_index = NULL;
832 }
833
834 if (remove_path(midx.buf))
midx.h
-2
@@ -35,8 +35,6 @@ struct odb_source;
35 "GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL"
36
37 struct multi_pack_index {
38 - struct multi_pack_index *next;
39 -
38 const unsigned char *data;
39 size_t data_len;
40
odb.h
-7
@@ -123,13 +123,6 @@ struct object_database {
123 struct commit_graph *commit_graph;
124 unsigned commit_graph_attempted : 1; /* if loading has been attempted */
125
126 - /*
127 - * private data
128 - *
129 - * should only be accessed directly by packfile.c and midx.c
130 - */
131 - struct multi_pack_index *multi_pack_index;
132 -
126 /*
127 * private data
128 *
packfile.c
-1
@@ -375,7 +375,6 @@ void close_object_store(struct object_database *o)
375 close_midx(source->midx);
376 source->midx = NULL;
377 }
378 - o->multi_pack_index = NULL;
378
379 close_commit_graph(o);
380 }