aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-04-01 17:56:27 -0700
committerJunio C Hamano <gitster@pobox.com>2011-04-01 17:56:27 -0700
commitb966427b53b246e722df1e5502b9145eb9dd063a (patch)
tree64df791944fd20ba8c49dc5043aa25681f07e1c7 /t
parent6c80cd298a9f2f36ae4e741cf65d94b7c184fb82 (diff)
parentb22520a37c8472751f2c4b3da9b5bc4e5aa5a0a3 (diff)
downloadgit-b966427b53b246e722df1e5502b9145eb9dd063a.tar.gz
git-b966427b53b246e722df1e5502b9145eb9dd063a.tar.xz
Merge branch 'jr/grep-en-config'
* jr/grep-en-config: grep: allow -E and -n to be turned on by default via configuration
Diffstat (limited to 't')
-rwxr-xr-xt/t7810-grep.sh24
1 files changed, 23 insertions, 1 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index dbc6cd8a7..8184c264c 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -59,7 +59,29 @@ do
echo ${HC}file:4:foo mmap bar_mmap
echo ${HC}file:5:foo_mmap bar mmap baz
} >expected &&
- git grep -n -w -e mmap $H >actual &&
+ git -c grep.linenumber=false grep -n -w -e mmap $H >actual &&
+ test_cmp expected actual
+ '
+
+ test_expect_success "grep -w $L" '
+ {
+ echo ${HC}file:1:foo mmap bar
+ echo ${HC}file:3:foo_mmap bar mmap
+ echo ${HC}file:4:foo mmap bar_mmap
+ echo ${HC}file:5:foo_mmap bar mmap baz
+ } >expected &&
+ git -c grep.linenumber=true grep -w -e mmap $H >actual &&
+ test_cmp expected actual
+ '
+
+ test_expect_success "grep -w $L" '
+ {
+ echo ${HC}file:foo mmap bar
+ echo ${HC}file:foo_mmap bar mmap
+ echo ${HC}file:foo mmap bar_mmap
+ echo ${HC}file:foo_mmap bar mmap baz
+ } >expected &&
+ git -c grep.linenumber=true grep --no-line-number -w -e mmap $H >actual &&
test_cmp expected actual
'