mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user