Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2009-11-22 18:58:09 +0300
committerJunio C Hamano <gitster@pobox.com>2009-11-23 03:20:59 +0300
commitb48275998399561780af85d429da3caceeecd2fe (patch)
tree35e86d626dc048e75ed6e470a4571fe76ec78407 /builtin-grep.c
parent73a1d050c47dfa0fc758eedd9d3bb60b7449e14f (diff)
grep: unset GREP_OPTIONS before spawning external grep
While we're at it, also unset GREP_COLOR and GREP_COLORS in case colouring is not enabled, to be on the safe side. The presence of these variables alone is not sufficient to trigger coloured output with GNU grep, but other implementations may behave differently. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-grep.c')
-rw-r--r--builtin-grep.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin-grep.c b/builtin-grep.c
index 01be9bf7ff..9a9e3fccd5 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -433,7 +433,11 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
if (opt->color_external && strlen(opt->color_external) > 0)
push_arg(opt->color_external);
+ } else {
+ unsetenv("GREP_COLOR");
+ unsetenv("GREP_COLORS");
}
+ unsetenv("GREP_OPTIONS");
hit = 0;
argc = nr;