From f5f1062d72ac6940cd26b7bc11310641a54cc46e Mon Sep 17 00:00:00 2001 From: Anton Onufriev Date: Tue, 30 Aug 2016 12:53:42 +0300 Subject: [PATCH] Remove colors from git-branch output for correct local search (#4545) We got an error while switching on existent local branch because git module can not find branch in function get_branches if we have color.branch=always in git config. --- lib/ansible/modules/source_control/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/source_control/git.py b/lib/ansible/modules/source_control/git.py index 82fe94c0403..1641eac6498 100644 --- a/lib/ansible/modules/source_control/git.py +++ b/lib/ansible/modules/source_control/git.py @@ -490,7 +490,7 @@ def is_remote_tag(git_path, module, dest, remote, version): def get_branches(git_path, module, dest): branches = [] - cmd = '%s branch -a' % (git_path,) + cmd = '%s branch --no-color -a' % (git_path,) (rc, out, err) = module.run_command(cmd, cwd=dest) if rc != 0: module.fail_json(msg="Could not determine branch data - received %s" % out, stdout=out, stderr=err)