summaryrefslogtreecommitdiff
path: root/source_control/git.py
diff options
context:
space:
mode:
authorAnton Onufriev <anufant@gmail.com>2016-08-30 12:53:42 +0300
committerMichael Scherer <mscherer@users.noreply.github.com>2016-08-30 11:53:42 +0200
commit2ca16dfaadaaa40e2003e9e43a499d4a205fb7a7 (patch)
treead534d12cd17ff02666ba8d2d7b2ec66c609d09c /source_control/git.py
parent5310bab12f6013195ac0e770472d593552271b11 (diff)
downloadansible-modules-core-2ca16dfaadaaa40e2003e9e43a499d4a205fb7a7.tar.gz
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.
Diffstat (limited to 'source_control/git.py')
-rw-r--r--source_control/git.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/source_control/git.py b/source_control/git.py
index 82fe94c0..1641eac6 100644
--- a/source_control/git.py
+++ b/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)