[git] Determine branch name more reliable (#907)
* Made some changes to determine branch name more reliable (it may contain slashes now). * Determination of branch name more reliable, as per comment on PR #907
This commit is contained in:
parent
a2a6b5247f
commit
2942b383c4
1 changed files with 1 additions and 1 deletions
|
@ -522,7 +522,7 @@ def get_head_branch(git_path, module, dest, remote, bare=False):
|
|||
if is_not_a_branch(git_path, module, dest):
|
||||
f.close()
|
||||
f = open(os.path.join(repo_path, 'refs', 'remotes', remote, 'HEAD'))
|
||||
branch = f.readline().split('/')[-1].rstrip("\n")
|
||||
branch = f.readline().split(' ')[-1].replace('refs/remotes/' + remote + '/','',1).rstrip("\n")
|
||||
f.close()
|
||||
return branch
|
||||
|
||||
|
|
Loading…
Reference in a new issue