summaryrefslogtreecommitdiff
path: root/source_control
diff options
context:
space:
mode:
authorTimmo Verlaan <tverlaan@users.noreply.github.com>2016-08-15 20:54:11 +0200
committerjctanner <tanner.jc@gmail.com>2016-08-15 14:54:11 -0400
commit2942b383c4dde13cd4ad2911b6b0e474caa28f14 (patch)
tree582514b49889f91564b5ce19c8c05d23f6925ddc /source_control
parenta2a6b5247f97309273b045536d2fc861068ddd87 (diff)
downloadansible-modules-core-2942b383c4dde13cd4ad2911b6b0e474caa28f14.tar.gz
[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
Diffstat (limited to 'source_control')
-rw-r--r--source_control/git.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/source_control/git.py b/source_control/git.py
index e556d708..0997be67 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