Merge branch 'tb/open-midx-bitmap-fallback'

Gracefully deal with a stale MIDX file that lists a packfile that
no longer exists.

* tb/open-midx-bitmap-fallback:
  pack-bitmap.c: gracefully degrade on failure to load MIDX'd pack
This commit is contained in:
Junio C Hamano
2023-06-23 11:21:17 -07:00
2 changed files with 40 additions and 3 deletions

View File

@ -387,9 +387,11 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
}
for (i = 0; i < bitmap_git->midx->num_packs; i++) {
if (prepare_midx_pack(the_repository, bitmap_git->midx, i))
die(_("could not open pack %s"),
bitmap_git->midx->pack_names[i]);
if (prepare_midx_pack(the_repository, bitmap_git->midx, i)) {
warning(_("could not open pack %s"),
bitmap_git->midx->pack_names[i]);
goto cleanup;
}
}
preferred = bitmap_git->midx->packs[midx_preferred_pack(bitmap_git)];