git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Re* [BUG] "git checkout -b" erronously thinks a branch already exists

From
Stefano Lattarini <stefano.lattarini@gmail.com>
Date
Jun 6, 2011, 08:26 UTC
Message-ID
<201106061026.38996.stefano.lattarini@gmail.com>
In-Reply-To
<7v1uz7bkc9.fsf@alter.siamese.dyndns.org>
Hello Junio, and thanks for your quick answer.
On Monday 06 June 2011, Junio C wrote:
Show 14 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > I think the right fix is to make sure that "refs/heads/<name>" does not
> > exist by checking exactly that.
> >
> > Perhaps something like this.  I am not sure if we want to use the "yield
> > non zero to signal not an error but an early return" trick like I did in
> > this patch, though.
> 
> Let's do this instead. I don't know what I was thinking when I wrote that
> inefficient "loop refs to see if there is that one" patch.
> 
> [CUT PATCH]
>
I can confirm this change fixes the problem for me.
Thanks,
  Stefano
Previous: Junio C HamanoNext: Jeff King
Message 4 of 5 in “[BUG] "git checkout -b" erronously thinks a branch already exists”
  1. Stefano LattariniJun 5, 2011
  2. Re* [BUG] "git checkout -b" erronously thinks a branch already existsJunio C Hamano, Jun 6, 2011
  3. Junio C HamanoJun 6, 2011
  4. Stefano LattariniJun 6, 2011
  5. Jeff KingJun 6, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.