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.
This commit is contained in:
Anton Onufriev 2016-08-30 12:53:42 +03:00 committed by Matt Clay
parent ee5a48b84d
commit f5f1062d72

View file

@ -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)