From 3ec51ce5878b2d52c7410521e64b184c22528063 Mon Sep 17 00:00:00 2001 From: Stephen Fromm Date: Tue, 23 Oct 2012 23:34:53 -0700 Subject: [PATCH] Checkout branch before rebase in switch_version --- git | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git b/git index fe354b45bfe..dbc0cf5857d 100755 --- a/git +++ b/git @@ -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)