diff --git a/lib/ansible/modules/source_control/git.py b/lib/ansible/modules/source_control/git.py index 4830e8ea67b..eec76e4133f 100644 --- a/lib/ansible/modules/source_control/git.py +++ b/lib/ansible/modules/source_control/git.py @@ -819,6 +819,8 @@ def main(): if local_mods: module.exit_json(changed=True, before=before, after=remote_head, msg="Local modifications exist") + elif version == 'HEAD': + repo_updated = False elif is_remote_tag(git_path, module, dest, repo, version): # if the remote is a tag and we have the tag locally, exit early if version in get_tags(git_path, module, dest):