packfile: add all_packs list

If a repo contains a multi-pack-index, then the packed_git list
does not contain the packfiles that are covered by the multi-pack-index.
This is important for doing object lookups, abbreviations, and
approximating object count. However, there are many operations that
really want to iterate over all packfiles.

Create a new 'all_packs' linked list that contains this list, starting
with the packfiles in the multi-pack-index and then continuing along
the packed_git linked list.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Derrick Stolee
2018-08-20 16:52:02 +00:00
committed by Junio C Hamano
parent 29e2016b8f
commit 0bff5269d3
5 changed files with 36 additions and 1 deletions

2
midx.c
View File

@ -197,7 +197,7 @@ static void close_midx(struct multi_pack_index *m)
FREE_AND_NULL(m->pack_names);
}
static int prepare_midx_pack(struct multi_pack_index *m, uint32_t pack_int_id)
int prepare_midx_pack(struct multi_pack_index *m, uint32_t pack_int_id)
{
struct strbuf pack_name = STRBUF_INIT;