Commit 3fba6e9c by Michael DeHaan

Merge branch 'git_undefined_branch_variable' of git://github.com/psvo/ansible into devel

parents d485abe2 d9576b35
...@@ -279,7 +279,10 @@ def switch_version(git_path, module, dest, remote, version): ...@@ -279,7 +279,10 @@ def switch_version(git_path, module, dest, remote, version):
cmd = "%s reset --hard %s" % (git_path, remote) cmd = "%s reset --hard %s" % (git_path, remote)
(rc, out1, err1) = module.run_command(cmd) (rc, out1, err1) = module.run_command(cmd)
if rc != 0: if rc != 0:
module.fail_json(msg="Failed to checkout branch %s" % (branch)) if version != 'HEAD':
module.fail_json(msg="Failed to checkout %s" % (version))
else:
module.fail_json(msg="Failed to checkout branch %s" % (branch))
(rc, out2, err2) = submodule_update(git_path, module, dest) (rc, out2, err2) = submodule_update(git_path, module, dest)
return (rc, out1 + out2, err1 + err2) return (rc, out1 + out2, err1 + err2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment