summaryrefslogtreecommitdiff
path: root/t/t7002-grep.sh
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2009-11-22 15:58:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-11-23 00:20:59 (GMT)
commitb48275998399561780af85d429da3caceeecd2fe (patch)
tree35e86d626dc048e75ed6e470a4571fe76ec78407 /t/t7002-grep.sh
parent73a1d050c47dfa0fc758eedd9d3bb60b7449e14f (diff)
downloadgit-b48275998399561780af85d429da3caceeecd2fe.zip
git-b48275998399561780af85d429da3caceeecd2fe.tar.gz
git-b48275998399561780af85d429da3caceeecd2fe.tar.bz2
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 't/t7002-grep.sh')
-rwxr-xr-xt/t7002-grep.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh
index ae5290a..dd0da6c 100755
--- a/t/t7002-grep.sh
+++ b/t/t7002-grep.sh
@@ -213,6 +213,11 @@ test_expect_success 'grep -e A --and --not -e B' '
test_cmp expected actual
'
+test_expect_success 'grep should ignore GREP_OPTIONS' '
+ GREP_OPTIONS=-v git grep " mmap bar\$" >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'grep -f, non-existent file' '
test_must_fail git grep -f patterns
'