Skip to content

Commit

Permalink
Checkout branch before rebase in switch_version
Browse files Browse the repository at this point in the history
  • Loading branch information
sfromm committed Nov 7, 2012
1 parent ccc04cf commit 328951e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/git
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 328951e

Please sign in to comment.