[issue2920] attempt to create an existing branch in a git subrepo

ben hockey bugs at mercurial.selenic.com
Fri Jul 22 16:22:08 CDT 2011


New submission from ben hockey <neonstalwart at gmail.com>:

i have a situation where mercurial fails to properly update a git subrepo.

it seems that at some point a branch called 'origin/master' is mistakenly 
created - the 'master' branch existed and should have been used.  after 
this, when i try to hg pull --update i get an error because another attempt 
is made to create the 'origin/master' branch again.  

i haven't yet been able to pinpoint the exact conditions that cause this but 
below is some of the debug output for a failed command:

static/cws2/external/twine: git config 
branch.refs/heads/origin/master.remote
static/cws2/external/twine: git config branch.refs/heads/master.remote
static/cws2/external/twine: git checkout -b origin/master 
refs/remotes/origin/master
fatal: git checkout: branch origin/master already exists
abort: git checkout error 128 in static/cws2/external/twine

the first call to git config should be like this

git config branch.master.remote

it seems that there is some mismatch with string substitution using branch 
names, refs, etc.  i'm not sure if i have found the root cause but the line 
that results in the wrong call to config is 
http://selenic.com/repo/hg/file/96a72cbc6c29/mercurial/subrepo.py#l812 - its 
using the ref instead of the branch name.

----------
messages: 16955
nosy: neonstalwart
priority: bug
status: unread
title: attempt to create an existing branch in a git subrepo

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2920>
____________________________________________________


More information about the Mercurial-devel mailing list