Re: [PATCH 2/2] builtin/pack-objects.c: ensure pack validity from MIDX bitmap objects
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- May 16, 2022, 06:07 UTC
- Message-ID
- <20220516060744.1567449-1-jonathantanmy@google.com>
- In-Reply-To
- <Yn+r4lPi8vNK/qFG@nand.local>
Taylor Blau <me@ttaylorr.com> 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.
Show 8 quoted lines
> 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.