From 2942b383c4dde13cd4ad2911b6b0e474caa28f14 Mon Sep 17 00:00:00 2001 From: Timmo Verlaan Date: Mon, 15 Aug 2016 20:54:11 +0200 Subject: [PATCH] [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 --- source_control/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source_control/git.py b/source_control/git.py index e556d70854a..0997be67c92 100644 --- a/source_control/git.py +++ b/source_control/git.py @@ -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