Re: [PATCH v2 1/1] upload-pack: advertise capabilities when cloning empty repos
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 1, 2023, 22:51 UTC
- Message-ID
- <xmqqzg6n1x8g.fsf@gitster.g>
- In-Reply-To
- <20230501224038.GA1174291@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> @@ -1382,8 +1386,10 @@ void upload_pack(const int advertise_refs, const int stateless_rpc,
> data.no_done = 1;
> head_ref_namespaced(send_ref, &data);
> for_each_namespaced_ref(send_ref, &data);
> - if (!data.sent_capabilities)
> - send_ref("capabilities^{}", null_oid(), 0, &data);
> + if (!data.sent_capabilities) {
> + const char *ref = "capabilities^{}";
> + write_v0_ref(&data, ref, ref, null_oid());
> + }Ah, this separation of duties wrt the namespace stripping makes the result easier to read.
The version brian posted looked good enough to me, but if we are to have another iteration, incorporating this change would be nice.
Thanks.