Re: [PATCH 2/2] builtin/pack-objects.c: ensure pack validity from MIDX bitmap objects
From: Jonathan Tan <hidden>
Date: 2022-05-16 06:07:55
From: Jonathan Tan <hidden>
Date: 2022-05-16 06:07:55
Taylor Blau [off-list ref] writes:
Perhaps changing the parenthetical to be:
(indicating that `want_object_in_pack()` should continue searching
for other packs containing this object)This works, thanks.
Yes, `want_found_object()` could have returned -1 before, but the only time when `*found_pack != NULL` and `want_found_object()` would have returned -1 is when given `--local` with at least one non-local pack. I actually think it's possible we have a bug there, since AFAICT the pre-image of this patch would have left the non-NULL `*found_pack` alone but picked a copy of the given object from a _different_ pack. So I think this change inadvertently resolves that bug.
[snip]
I think my reply above indicates why this change is necessary, but if we're talking about separate issues, let me know.
Ah, I was presupposing that the existing code works correctly. But yes, this makes sense.