Git fork

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>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
ec865d94 c620586f

+2 -26
+2 -16
midx.c
··· 726 726 int prepare_multi_pack_index_one(struct odb_source *source, int local) 727 727 { 728 728 struct repository *r = source->odb->repo; 729 - struct multi_pack_index *m; 730 729 731 730 prepare_repo_settings(r); 732 731 if (!r->settings.core_multi_pack_index) ··· 735 734 if (source->midx) 736 735 return 1; 737 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); 748 738 749 - return 1; 750 - } 751 - 752 - return 0; 739 + return !!source->midx; 753 740 } 754 741 755 742 int midx_checksum_valid(struct multi_pack_index *m) ··· 842 829 close_midx(source->midx); 843 830 source->midx = NULL; 844 831 } 845 - r->objects->multi_pack_index = NULL; 846 832 } 847 833 848 834 if (remove_path(midx.buf))
-2
midx.h
··· 35 35 "GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL" 36 36 37 37 struct multi_pack_index { 38 - struct multi_pack_index *next; 39 - 40 38 const unsigned char *data; 41 39 size_t data_len; 42 40
-7
odb.h
··· 126 126 /* 127 127 * private data 128 128 * 129 - * should only be accessed directly by packfile.c and midx.c 130 - */ 131 - struct multi_pack_index *multi_pack_index; 132 - 133 - /* 134 - * private data 135 - * 136 129 * should only be accessed directly by packfile.c 137 130 */ 138 131
-1
packfile.c
··· 375 375 close_midx(source->midx); 376 376 source->midx = NULL; 377 377 } 378 - o->multi_pack_index = NULL; 379 378 380 379 close_commit_graph(o); 381 380 }