[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:
Timmo Verlaan 2016-08-15 20:54:11 +02:00 committed by jctanner
parent a2a6b5247f
commit 2942b383c4

View file

@ -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