Re: [PATCH 05/13] upload-pack: convert to use `reference_get_peeled_oid()`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 8, 2025, 13:45 UTC
- Message-ID
- <aOZq5UtJglYQhD26@pks.im>
- In-Reply-To
- <CAOLa=ZRdcXUQLXK1s1JLgZAcEYx=kT-eS6CMzCocJ9Oenia_Jw@mail.gmail.com>
On Tue, Oct 07, 2025 at 09:18:52AM -0700, Karthik Nayak wrote:
Show 17 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > > > The `write_v0_ref()` callback is invoked from two callsites: > > > > Okay so this function does multiple things based on whether the > capabilities are already advertised or not. > > - If not, we propagate the capabilities and set the static variable > `capabilities` to NULL and also set `data->sent_capabilities = 1;`. > - We receive `ref->oid` as a zero oid for the hash algorithm being > used, we convert it to the hex format with `oid_to_hex()`. > - If already advertised, we simply propagate the reference and if it can > be peeled, also propagate the peeled reference. > > Not for your series: but this feels like the capabilities should be an > independent function.
Yeah, agreed, it's a bit of a weird design choice that should be cleaned up eventually.
Patrick