From: Junio C Hamano Date: Mon, 01 May 2023 22:51:43 GMT Subject: Re: [PATCH v2 1/1] upload-pack: advertise capabilities when cloning empty repos Message-ID: In-Reply-To: <20230501224038.GA1174291@coredump.intra.peff.net> Jeff King writes: > @@ -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.