Re: Cloning empty repository uses locally configured default branch name
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 8, 2020, 21:00 UTC
- Message-ID
- <xmqqim9c6mj4.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20201208185538.973044-1-jonathantanmy@google.com>
Jonathan Tan <jonathantanmy@google.com> writes:
Show 13 quoted lines
>> > A small issue is that upload-pack protocol v0 doesn't even write the
>> > blank ref line ("000...000 capabilities^{}") if HEAD points to an unborn
>> > branch, but that can be fixed as in the patch below.
>>
>> I think the codepaths we have today in process_capabilities() and
>> process_dummy_ref() (both in connect.c) would do the right thing
>> when it sees a blank ref line even when nothing gets transported,
>> but I smell that the rewrite of this state machine is fairly recent
>> (say in the past few years) and I do not offhand know if clients
>> before the rewrite of the state machine (say in v2.18.0) would be OK
>> with the change. It should be easy to check, though.
>
> Yes - I backported my patch to v2.17.0 and it works:I wouldn't be surprised if other reimplementations of Git (like jgit, libgit2 and Go or Python or whatever your favorite language) barfs, though.