midx: stop reporting garbage
When prepare_packed_git is called with the report_garbage method initialized, we report unexpected files in the objects directory as garbage. Stop reporting the multi-pack-index and the pack-files it covers as garbage. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
c39b02ae0a
commit
fe86c3beb5
@ -820,9 +820,8 @@ static void prepare_pack(const char *full_name, size_t full_name_len,
|
|||||||
struct packed_git *p;
|
struct packed_git *p;
|
||||||
size_t base_len = full_name_len;
|
size_t base_len = full_name_len;
|
||||||
|
|
||||||
if (strip_suffix_mem(full_name, &base_len, ".idx")) {
|
if (strip_suffix_mem(full_name, &base_len, ".idx") &&
|
||||||
if (data->m && midx_contains_pack(data->m, file_name))
|
!(data->m && midx_contains_pack(data->m, file_name))) {
|
||||||
return;
|
|
||||||
/* Don't reopen a pack we already have. */
|
/* Don't reopen a pack we already have. */
|
||||||
for (p = data->r->objects->packed_git; p; p = p->next) {
|
for (p = data->r->objects->packed_git; p; p = p->next) {
|
||||||
size_t len;
|
size_t len;
|
||||||
@ -842,6 +841,8 @@ static void prepare_pack(const char *full_name, size_t full_name_len,
|
|||||||
if (!report_garbage)
|
if (!report_garbage)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!strcmp(file_name, "multi-pack-index"))
|
||||||
|
return;
|
||||||
if (ends_with(file_name, ".idx") ||
|
if (ends_with(file_name, ".idx") ||
|
||||||
ends_with(file_name, ".pack") ||
|
ends_with(file_name, ".pack") ||
|
||||||
ends_with(file_name, ".bitmap") ||
|
ends_with(file_name, ".bitmap") ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user