1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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

This commit is contained in:
Michael DeHaan 2013-08-03 13:12:48 -04:00
commit 3fba6e9cff

View file

@ -279,7 +279,10 @@ def switch_version(git_path, module, dest, remote, version):
cmd = "%s reset --hard %s" % (git_path, remote)
(rc, out1, err1) = module.run_command(cmd)
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)
return (rc, out1 + out2, err1 + err2)