Skip to content

Commit b327bf7

Browse files
Michael J Grubergitster
authored andcommitted
t7810-grep: bring log --grep tests in common form
The log --grep tests generate the expected out in different ways. Make them all use command blocks so that subshells are avoided and the expected output is easier to grasp visually. Signed-off-by: Michael J Gruber <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 07a7d65 commit b327bf7

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

t/t7810-grep.sh

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,31 +435,41 @@ test_expect_success 'log grep setup' '
435435

436436
test_expect_success 'log grep (1)' '
437437
git log --author=author --pretty=tformat:%s >actual &&
438-
( echo third ; echo initial ) >expect &&
438+
{
439+
echo third && echo initial
440+
} >expect &&
439441
test_cmp expect actual
440442
'
441443

442444
test_expect_success 'log grep (2)' '
443445
git log --author=" * " -F --pretty=tformat:%s >actual &&
444-
( echo second ) >expect &&
446+
{
447+
echo second
448+
} >expect &&
445449
test_cmp expect actual
446450
'
447451

448452
test_expect_success 'log grep (3)' '
449453
git log --author="^A U" --pretty=tformat:%s >actual &&
450-
( echo third ; echo initial ) >expect &&
454+
{
455+
echo third && echo initial
456+
} >expect &&
451457
test_cmp expect actual
452458
'
453459

454460
test_expect_success 'log grep (4)' '
455461
git log --author="frotz\.com>$" --pretty=tformat:%s >actual &&
456-
( echo second ) >expect &&
462+
{
463+
echo second
464+
} >expect &&
457465
test_cmp expect actual
458466
'
459467

460468
test_expect_success 'log grep (5)' '
461469
git log --author=Thor -F --pretty=tformat:%s >actual &&
462-
( echo third ; echo initial ) >expect &&
470+
{
471+
echo third && echo initial
472+
} >expect &&
463473
test_cmp expect actual
464474
'
465475

@@ -473,7 +483,9 @@ test_expect_success 'log --grep --author implicitly uses all-match' '
473483
# grep matches initial and second but not third
474484
# author matches only initial and third
475485
git log --author="A U Thor" --grep=s --grep=l --format=%s >actual &&
476-
echo initial >expect &&
486+
{
487+
echo initial
488+
} >expect &&
477489
test_cmp expect actual
478490
'
479491

0 commit comments

Comments
 (0)