]> git.ipfire.org Git - thirdparty/git.git/commit
pack-bitmap.c: continue looping when first MIDX bitmap is found
authorTeng Long <dyroneteng@gmail.com>
Mon, 18 Jul 2022 16:46:05 +0000 (00:46 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Jul 2022 18:20:52 +0000 (11:20 -0700)
commit5dcee7c7059307ca3a9d5c1a5c6551deb25cc3dc
treed671047020640e08fc9c4b862e3584d277da9277
parent9005eb021ad4defbb3635c2aa6049e9300a25798
pack-bitmap.c: continue looping when first MIDX bitmap is found

In "open_midx_bitmap()", we do a loop with the MIDX(es) in repo, when
the first one has been found, then will break out by a "return"
directly.

But actually, it's better to continue the loop until we have visited
both the MIDX in our repository, as well as any alternates (along with
_their_ alternates, recursively).

The reason for this is, there may exist more than one MIDX file in
a repo. The "multi_pack_index" struct is actually designed as a singly
linked list, and if a MIDX file has been already opened successfully,
then the other MIDX files will be skipped and left with a warning
"ignoring extra bitmap file." to the output.

The discussion link of community:

  https://public-inbox.org/git/YjzCTLLDCby+kJrZ@nand.local/

Helped-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap.c