Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t7810-grep: test --all-match with multiple --grep and --author options
author
Michael J Gruber
<git@drmicha.warpmail.net>
Fri, 14 Sep 2012 09:46:43 +0000
(11:46 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Sun, 16 Sep 2012 06:35:40 +0000
(23:35 -0700)
The code used to have a bug that ignores "--all-match", that requires
all "--grep" to have matched, when "--author" or "--committer" was used.
Make sure the bug will not be reintroduced.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7810-grep.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
2cb03e7
)
diff --git
a/t/t7810-grep.sh
b/t/t7810-grep.sh
index f6edb4d6dc66cedf25cda69d959989f54aaf8f74..b5c488e3a55304125548afafd8f94ac442930045 100755
(executable)
--- a/
t/t7810-grep.sh
+++ b/
t/t7810-grep.sh
@@
-531,6
+531,16
@@
test_expect_success 'log --grep --grep --author takes union of greps and interse
test_cmp expect actual
'
test_cmp expect actual
'
+test_expect_success 'log ---all-match -grep --author --author still takes union of authors and intersects with grep' '
+ # grep matches only initial and third
+ # author matches all but second
+ git log --all-match --author="Thor" --author="Night" --grep=i --format=%s >actual &&
+ {
+ echo third && echo initial
+ } >expect &&
+ test_cmp expect actual
+'
+
test_expect_success 'log --grep --author --author takes union of authors and intersects with grep' '
# grep matches only initial and third
# author matches all but second
test_expect_success 'log --grep --author --author takes union of authors and intersects with grep' '
# grep matches only initial and third
# author matches all but second
@@
-541,6
+551,16
@@
test_expect_success 'log --grep --author --author takes union of authors and int
test_cmp expect actual
'
test_cmp expect actual
'
+test_expect_success 'log --all-match --grep --grep --author takes intersection' '
+ # grep matches only third
+ # author matches only initial and third
+ git log --all-match --author="A U Thor" --grep=i --grep=r --format=%s >actual &&
+ {
+ echo third
+ } >expect &&
+ test_cmp expect actual
+'
+
test_expect_success 'grep with CE_VALID file' '
git update-index --assume-unchanged t/t &&
rm t/t &&
test_expect_success 'grep with CE_VALID file' '
git update-index --assume-unchanged t/t &&
rm t/t &&