From: Patrick Steinhardt Date: Wed, 08 Oct 2025 13:45:09 GMT Subject: Re: [PATCH 05/13] upload-pack: convert to use `reference_get_peeled_oid()` Message-ID: In-Reply-To: On Tue, Oct 07, 2025 at 09:18:52AM -0700, Karthik Nayak wrote: > Patrick Steinhardt 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