diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-02-13 23:09:33 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-02-13 23:09:33 (GMT) |
commit | e7c2466593f5c8682a4fe7146f17b80acf134675 (patch) | |
tree | 0fdba9fc0d9b936486b560599b922a2c57c917f1 /t | |
parent | 318721e3acd8f9c06fde0d528b7547a99f65c4a1 (diff) | |
parent | 1123c67ceee2f310b08ab5d67b076ef04ab59bfc (diff) | |
download | git-e7c2466593f5c8682a4fe7146f17b80acf134675.zip git-e7c2466593f5c8682a4fe7146f17b80acf134675.tar.gz git-e7c2466593f5c8682a4fe7146f17b80acf134675.tar.bz2 |
Merge branch 'jk/grep-double-dash'
* jk/grep-double-dash:
accept "git grep -- pattern"
Diffstat (limited to 't')
-rwxr-xr-x | t/t7002-grep.sh | 33 |
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 |