t7810-grep: test multiple --grep with and without --all-match

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael J Gruber committed Sep 14, 2012 at 11:46 UTC dfe3642515d3d2679bdc25c2be4d961201e9f095
1 file changed +16
t/t7810-grep.sh
+16
@@ -479,6 +479,22 @@ test_expect_success 'log grep (6)' '
479 test_cmp expect actual
480 '
481
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 +
498 test_expect_success 'log --grep --author implicitly uses all-match' '
499 # grep matches initial and second but not third
500 # author matches only initial and third