Skip to content

Commit ec865d9

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c620586 commit ec865d9

File tree

4 files changed

+2
-26
lines changed

4 files changed

+2
-26
lines changed

midx.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,6 @@ int midx_preferred_pack(struct multi_pack_index *m, uint32_t *pack_int_id)
726726
int prepare_multi_pack_index_one(struct odb_source *source, int local)
727727
{
728728
struct repository *r = source->odb->repo;
729-
struct multi_pack_index *m;
730729

731730
prepare_repo_settings(r);
732731
if (!r->settings.core_multi_pack_index)
@@ -735,21 +734,9 @@ int prepare_multi_pack_index_one(struct odb_source *source, int local)
735734
if (source->midx)
736735
return 1;
737736

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);
748738

749-
return 1;
750-
}
751-
752-
return 0;
739+
return !!source->midx;
753740
}
754741

755742
int midx_checksum_valid(struct multi_pack_index *m)
@@ -842,7 +829,6 @@ void clear_midx_file(struct repository *r)
842829
close_midx(source->midx);
843830
source->midx = NULL;
844831
}
845-
r->objects->multi_pack_index = NULL;
846832
}
847833

848834
if (remove_path(midx.buf))

midx.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ struct odb_source;
3535
"GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL"
3636

3737
struct multi_pack_index {
38-
struct multi_pack_index *next;
39-
4038
const unsigned char *data;
4139
size_t data_len;
4240

odb.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,6 @@ struct object_database {
123123
struct commit_graph *commit_graph;
124124
unsigned commit_graph_attempted : 1; /* if loading has been attempted */
125125

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-
133126
/*
134127
* private data
135128
*

packfile.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ void close_object_store(struct object_database *o)
375375
close_midx(source->midx);
376376
source->midx = NULL;
377377
}
378-
o->multi_pack_index = NULL;
379378

380379
close_commit_graph(o);
381380
}

0 commit comments

Comments
 (0)