diff --git a/lib/ansible/modules/source_control/git.py b/lib/ansible/modules/source_control/git.py index 5fcde3ba21..2b0e5dc08d 100644 --- a/lib/ansible/modules/source_control/git.py +++ b/lib/ansible/modules/source_control/git.py @@ -688,8 +688,8 @@ def main(): repo_updated = True # switch to version specified regardless of whether - # we cloned or pulled - if repo_updated and not bare: + # we got new revisions from the repository + if not bare: switch_version(git_path, module, dest, remote, version) # Deal with submodules