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.
pull/18777/head
Anton Onufriev 8 years ago committed by Matt Clay
parent ee5a48b84d
commit f5f1062d72

@ -490,7 +490,7 @@ def is_remote_tag(git_path, module, dest, remote, version):
def get_branches(git_path, module, dest): def get_branches(git_path, module, dest):
branches = [] branches = []
cmd = '%s branch -a' % (git_path,) cmd = '%s branch --no-color -a' % (git_path,)
(rc, out, err) = module.run_command(cmd, cwd=dest) (rc, out, err) = module.run_command(cmd, cwd=dest)
if rc != 0: if rc != 0:
module.fail_json(msg="Could not determine branch data - received %s" % out, stdout=out, stderr=err) module.fail_json(msg="Could not determine branch data - received %s" % out, stdout=out, stderr=err)

Loading…
Cancel
Save