diff options
author | Timmo Verlaan <tverlaan@users.noreply.github.com> | 2016-08-15 20:54:11 +0200 |
---|---|---|
committer | jctanner <tanner.jc@gmail.com> | 2016-08-15 14:54:11 -0400 |
commit | 2942b383c4dde13cd4ad2911b6b0e474caa28f14 (patch) | |
tree | 582514b49889f91564b5ce19c8c05d23f6925ddc /source_control | |
parent | a2a6b5247f97309273b045536d2fc861068ddd87 (diff) | |
download | ansible-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.py | 2 |
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 |