mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Checkout branch before rebase in switch_version
This commit is contained in:
parent
ccc04cf891
commit
328951ef53
1 changed files with 4 additions and 0 deletions
|
@ -182,6 +182,10 @@ def switch_version(module, dest, remote, version):
|
|||
cmd = "git checkout --force %s" % version
|
||||
else:
|
||||
# is there a better way to do this?
|
||||
branch = get_head_branch(module, dest, remote)
|
||||
(rc, out, err) = _run("git checkout --force %s" % branch)
|
||||
if rc != 0:
|
||||
module.fail_json(msg="Failed to checkout branch %s" % branch)
|
||||
cmd = "git rebase %s" % remote
|
||||
return _run(cmd)
|
||||
|
||||
|
|
Loading…
Reference in a new issue