return 0;
}
+struct multi_pack_index *get_multi_pack_index(struct odb_source *source)
+{
+ packfile_store_prepare(source->odb->packfiles);
+ return source->midx;
+}
+
static struct multi_pack_index *load_multi_pack_index_one(struct odb_source *source,
const char *midx_name)
{
void get_split_midx_filename_ext(struct odb_source *source, struct strbuf *buf,
const unsigned char *hash, const char *ext);
+struct multi_pack_index *get_multi_pack_index(struct odb_source *source);
struct multi_pack_index *load_multi_pack_index(struct odb_source *source);
int prepare_midx_pack(struct multi_pack_index *m, uint32_t pack_int_id);
struct packed_git *nth_midxed_pack(struct multi_pack_index *m,
list_add_tail(&p->mru, &store->mru);
}
-static void packfile_store_prepare(struct packfile_store *store)
+void packfile_store_prepare(struct packfile_store *store)
{
struct odb_source *source;
return r->objects->packfiles->packs;
}
-struct multi_pack_index *get_multi_pack_index(struct odb_source *source)
-{
- packfile_store_prepare(source->odb->packfiles);
- return source->midx;
-}
-
struct packed_git *get_all_packs(struct repository *r)
{
packfile_store_prepare(r->objects->packfiles);
*/
void packfile_store_close(struct packfile_store *store);
+/*
+ * Prepare the packfile store by loading packfiles and multi-pack indices for
+ * all alternates. This becomes a no-op if the store is already prepared.
+ *
+ * It shouldn't typically be necessary to call this function directly, as
+ * functions that access the store know to prepare it.
+ */
+void packfile_store_prepare(struct packfile_store *store);
+
/*
* Clear the packfile caches and try to look up any new packfiles that have
* appeared since last preparing the packfiles store.
struct packed_git *get_packed_git(struct repository *r);
struct list_head *get_packed_git_mru(struct repository *r);
-struct multi_pack_index *get_multi_pack_index(struct odb_source *source);
struct packed_git *get_all_packs(struct repository *r);
/*