Checkout branch before rebase in switch_version

pull/1648/head
Stephen Fromm 12 years ago
parent ccc04cf891
commit 328951ef53

@ -182,6 +182,10 @@ def switch_version(module, dest, remote, version):
cmd = "git checkout --force %s" % version cmd = "git checkout --force %s" % version
else: else:
# is there a better way to do this? # 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 cmd = "git rebase %s" % remote
return _run(cmd) return _run(cmd)

Loading…
Cancel
Save