Re: [PATCH 0/3] Unconfuse git clone when two branches at are HEAD.
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:58:42
"Philip Oakley" [off-list ref] writes:
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.