summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-02-17 22:55:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-02-17 22:55:15 (GMT)
commit031f82f75124dc96e3bebf8fa0b15eddf5544012 (patch)
tree294a13008dd8a12588453825ed2266be645b1ddd /t
parent07cb9a369e12633e1e43e0acded32885592a455c (diff)
parent1123c67ceee2f310b08ab5d67b076ef04ab59bfc (diff)
downloadgit-031f82f75124dc96e3bebf8fa0b15eddf5544012.zip
git-031f82f75124dc96e3bebf8fa0b15eddf5544012.tar.gz
git-031f82f75124dc96e3bebf8fa0b15eddf5544012.tar.bz2
Merge branch 'jk/grep-double-dash' into maint
* jk/grep-double-dash: accept "git grep -- pattern"
Diffstat (limited to 't')
-rwxr-xr-xt/t7002-grep.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh
index 7144f81..0b583cb 100755
--- a/t/t7002-grep.sh
+++ b/t/t7002-grep.sh
@@ -434,4 +434,37 @@ test_expect_success 'grep -Fi' '
test_cmp expected actual
'
+test_expect_success 'setup double-dash tests' '
+cat >double-dash <<EOF &&
+--
+->
+other
+EOF
+git add double-dash
+'
+
+cat >expected <<EOF
+double-dash:->
+EOF
+test_expect_success 'grep -- pattern' '
+ git grep -- "->" >actual &&
+ test_cmp expected actual
+'
+test_expect_success 'grep -- pattern -- pathspec' '
+ git grep -- "->" -- double-dash >actual &&
+ test_cmp expected actual
+'
+test_expect_success 'grep -e pattern -- path' '
+ git grep -e "->" -- double-dash >actual &&
+ test_cmp expected actual
+'
+
+cat >expected <<EOF
+double-dash:--
+EOF
+test_expect_success 'grep -e -- -- path' '
+ git grep -e -- -- double-dash >actual &&
+ test_cmp expected actual
+'
+
test_done