Commit dcd556b9 by Johan Wirén

Fixed so that we no longer check with the remote if a checkout already is at the…

Fixed so that we no longer check with the remote if a checkout already is at the desired sha version.
parent 714cb02f
...@@ -334,6 +334,10 @@ def main(): ...@@ -334,6 +334,10 @@ def main():
(rc, out, err) = reset(git_path, module, dest, force) (rc, out, err) = reset(git_path, module, dest, force)
if rc != 0: if rc != 0:
module.fail_json(msg=err) module.fail_json(msg=err)
# exit if already at desired sha version
# abbreviate version in case full sha is given
if before == str(version)[:7]:
module.exit_json(changed=False)
# check or get changes from remote # check or get changes from remote
remote_head = get_remote_head(git_path, module, dest, version, remote) remote_head = get_remote_head(git_path, module, dest, version, remote)
if module.check_mode: if module.check_mode:
......
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