Re: [PATCH 0/3] Unconfuse git clone when two branches at are HEAD.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 9, 2013, 22:26 UTC
- Message-ID
- <xmqqk3ip3a36.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CBB3BFF2B74D4A768238512FBF1CD6E7@PhilipOakley>
"Philip Oakley" <philipoakley@iee.org> writes:
Show 9 quoted lines
> These look to work OK. Not sure If I've properly covered all the > options. > > A nice feature is that ls-remote will find the fake ref ! > > $ git ls-remote /c/gitBundleTest1/RepoHEADnomaster.bundle Test:HEAD > 41ccb18028d1cb6516251e94cef1cd5cb3f0bcb5 refs/heads/Test:HEAD > > It's only the clone that barfs (so far) (which could be 'fixed').
You cannot 'fix' the ones deployed in the wild, but I think saying "funny ref" and not aborting is a good compromise. The updated documentation for bundle can mention that error message and explain that the older version of "clone" will say that in what situation.
I didn't notice it the first time, but I think the above would read better and match what has been discussed on the on-the-wire format to swap the order, i.e. use "HEAD:refs/heads/Test" to mean "HEAD is a symref that points at the Test branch".
> Obviously, if it can be made to work, one check would be that the two > refs (HEAD and refs/heads/wherever) point to the came commit before > generating the HEAD symref.
Yes, that is a sensible check.