@@ -637,7 +637,8 @@ test_expect_success 'Log output with --use-mailmap' '
637637 Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
638638 EOF
639639
640- git log --use-mailmap | grep Author >actual &&
640+ git log --use-mailmap >log &&
641+ grep Author log >actual &&
641642 test_cmp expect actual
642643'
643644
@@ -654,7 +655,8 @@ test_expect_success 'Log output with log.mailmap' '
654655 Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
655656 EOF
656657
657- git -c log.mailmap=True log | grep Author >actual &&
658+ git -c log.mailmap=True log >log &&
659+ grep Author log >actual &&
658660 test_cmp expect actual
659661'
660662
@@ -668,7 +670,8 @@ test_expect_success 'log.mailmap=false disables mailmap' '
668670669671 Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
670672 EOF
671- git -c log.mailmap=false log | grep Author >actual &&
673+ git -c log.mailmap=false log >log &&
674+ grep Author log >actual &&
672675 test_cmp expect actual
673676'
674677
@@ -682,7 +685,8 @@ test_expect_success '--no-use-mailmap disables mailmap' '
682685683686 Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
684687 EOF
685- git log --no-use-mailmap | grep Author > actual &&
688+ git log --no-use-mailmap >log &&
689+ grep Author log >actual &&
686690 test_cmp expect actual
687691'
688692
@@ -693,7 +697,8 @@ test_expect_success 'Grep author with --use-mailmap' '
693697 Author: Santa Claus <[email protected] > 694698 Author: Santa Claus <[email protected] > 695699 EOF
696- git log --use-mailmap --author Santa | grep Author >actual &&
700+ git log --use-mailmap --author Santa >log &&
701+ grep Author log >actual &&
697702 test_cmp expect actual
698703'
699704
@@ -705,13 +710,15 @@ test_expect_success 'Grep author with log.mailmap' '
705710 Author: Santa Claus <[email protected] > 706711 EOF
707712
708- git -c log.mailmap=True log --author Santa | grep Author >actual &&
713+ git -c log.mailmap=True log --author Santa >log &&
714+ grep Author log >actual &&
709715 test_cmp expect actual
710716'
711717
712718test_expect_success ' log.mailmap is true by default these days' '
713719 test_config mailmap.file complex.map &&
714- git log --author Santa | grep Author >actual &&
720+ git log --author Santa >log &&
721+ grep Author log >actual &&
715722 test_cmp expect actual
716723'
717724
@@ -742,11 +749,11 @@ test_expect_success 'Blame --porcelain output (complex mapping)' '
742749 EOF
743750
744751 git blame --porcelain one >actual.blame &&
745- grep -E \
746- -e "[0-9]+ [0-9]+ [0-9]+$" \
747- -e "^author .*$" \
748- actual.blame >actual.grep &&
749- cut -d " " -f2-4 <actual.grep >actual.fuzz &&
752+
753+ NUM= "[0-9][0-9]*" &&
754+ sed -n <actual.blame >actual.fuzz \
755+ -e "s/^author //p" \
756+ -e "s/^$OID_REGEX \\($NUM $NUM $NUM\\)$/\\1/p" &&
750757 test_cmp expect actual.fuzz
751758'
752759
0 commit comments