Skip to content

Commit dfe3642

Browse files
Michael J Grubergitster
authored andcommitted
t7810-grep: test multiple --grep with and without --all-match
Signed-off-by: Michael J Gruber <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b327bf7 commit dfe3642

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

t/t7810-grep.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,22 @@ test_expect_success 'log grep (6)' '
479479
test_cmp expect actual
480480
'
481481

482+
test_expect_success 'log with multiple --grep uses union' '
483+
git log --grep=i --grep=r --format=%s >actual &&
484+
{
485+
echo fourth && echo third && echo initial
486+
} >expect &&
487+
test_cmp expect actual
488+
'
489+
490+
test_expect_success 'log --all-match with multiple --grep uses intersection' '
491+
git log --all-match --grep=i --grep=r --format=%s >actual &&
492+
{
493+
echo third
494+
} >expect &&
495+
test_cmp expect actual
496+
'
497+
482498
test_expect_success 'log --grep --author implicitly uses all-match' '
483499
# grep matches initial and second but not third
484500
# author matches only initial and third

0 commit comments

Comments
 (0)