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
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-02-14 02:09:33 +0300
committerJunio C Hamano <gitster@pobox.com>2010-02-14 02:09:33 +0300
commite7c2466593f5c8682a4fe7146f17b80acf134675 (patch)
tree0fdba9fc0d9b936486b560599b922a2c57c917f1 /t
parent318721e3acd8f9c06fde0d528b7547a99f65c4a1 (diff)
parent1123c67ceee2f310b08ab5d67b076ef04ab59bfc (diff)
Merge branch 'jk/grep-double-dash'
* 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 7144f815c0..0b583cbfc1 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