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)
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)
close_midx(source->midx);
source->midx = NULL;
}
- r->objects->multi_pack_index = NULL;
}
if (remove_path(midx.buf))
"GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL"
struct multi_pack_index {
- struct multi_pack_index *next;
-
const unsigned char *data;
size_t data_len;
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
*