From 9c6db69827691d0112f2f701513f9546387025f6 Mon Sep 17 00:00:00 2001 From: Jan Duzinkiewicz Date: Tue, 23 Dec 2014 20:12:42 +0100 Subject: [PATCH] forcing git fetch if sha1 are equal between repos but branch exists only at remote Add an explanatory comment to the code --- lib/ansible/modules/source_control/git.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/source_control/git.py b/lib/ansible/modules/source_control/git.py index e4e3f3945d8..2d3d1542cb8 100644 --- a/lib/ansible/modules/source_control/git.py +++ b/lib/ansible/modules/source_control/git.py @@ -762,7 +762,9 @@ def main(): if version in get_tags(git_path, module, dest): repo_updated = False else: - repo_updated = False + # if the remote is a branch and we have the branch locally, exit early + if version in get_branches(git_path, module, dest): + repo_updated = False if repo_updated is None: if module.check_mode: module.exit_json(changed=True, before=before, after=remote_head)