Re: BUG or FEATURE? Use of '/' in branch names
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- May 4, 2014, 05:39 UTC
- Message-ID
- <5365D2A4.9010702@alum.mit.edu>
- In-Reply-To
- <1399102525.2716.1.camel@spirit>
On 05/03/2014 09:35 AM, Dennis Kaarsemaker wrote:
Show 14 quoted lines
> On vr, 2014-05-02 at 15:16 -0700, Jonathan Nieder wrote: >>> $ git checkout -b hotfix/b2 >>> error: unable to resolve reference refs/heads/hotfix/b2: Not a >> directory >>> fatal: Failed to lock ref for update: Not a directory >>> $ >> >> That's an ugly message. I think we can do better. (hint hint) > > 2.0.0-rc2 has a better message already: > > $ git checkout -b hotfix/b2 > error: 'refs/heads/hotfix' exists; cannot create 'refs/heads/hotfix/b2' > fatal: Failed to lock ref for update: Not a directory
I was trying to remember when this was changed, but at first I couldn't reproduce the "fixed" error message at all. Finally I figured out that the the error message that you get depends on whether the existing reference is loose:
$ bin-wrappers/git checkout -b master/foo
error: unable to resolve reference refs/heads/master/foo: Not a
directory
fatal: Failed to lock ref for update: Not a directoryvs. packed:
$ bin-wrappers/git checkout -b base/foo
error: 'refs/heads/base' exists; cannot create 'refs/heads/base/foo'
fatal: Failed to lock ref for update: Not a directoryIt would be good to make the error message uniform and to document this restriction.
Michael
-- Michael Haggerty mhagger@alum.mit.edu http://softwareswirl.blogspot.com/