|
|
@ -156,6 +156,8 @@ def pull(module, repo, dest, version):
|
|
|
|
cur_branch = b
|
|
|
|
cur_branch = b
|
|
|
|
if is_local_branch(module, dest, version) and not is_current_branch(module, dest, version):
|
|
|
|
if is_local_branch(module, dest, version) and not is_current_branch(module, dest, version):
|
|
|
|
(rc, out, err) = switch_version(module, dest, remote, version)
|
|
|
|
(rc, out, err) = switch_version(module, dest, remote, version)
|
|
|
|
|
|
|
|
if rc != 0:
|
|
|
|
|
|
|
|
module.fail_json(msg=err)
|
|
|
|
|
|
|
|
|
|
|
|
cmd = "git pull -u origin"
|
|
|
|
cmd = "git pull -u origin"
|
|
|
|
cmd = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
|
cmd = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
@ -222,10 +224,6 @@ def main():
|
|
|
|
if rc != 0:
|
|
|
|
if rc != 0:
|
|
|
|
module.fail_json(msg=err)
|
|
|
|
module.fail_json(msg=err)
|
|
|
|
|
|
|
|
|
|
|
|
# handle errors from clone or pull
|
|
|
|
|
|
|
|
if rc != 0:
|
|
|
|
|
|
|
|
module.fail_json(msg=err)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# switch to version specified regardless of whether
|
|
|
|
# switch to version specified regardless of whether
|
|
|
|
# we cloned or pulled
|
|
|
|
# we cloned or pulled
|
|
|
|
(rc, out, err) = switch_version(module, dest, remote, version)
|
|
|
|
(rc, out, err) = switch_version(module, dest, remote, version)
|
|
|
|