Skip to content

Commit afa80f5

Browse files
Denton-Lgitster
authored andcommitted
t4203: stop losing return codes of git commands
In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no git commands upstream so that their failure is reported. Signed-off-by: Denton Liu <[email protected]> Acked-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f9f30a0 commit afa80f5

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

t/t4203-mailmap.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ test_expect_success 'Log output with --use-mailmap' '
634634
Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
635635
EOF
636636
637-
git log --use-mailmap | grep Author >actual &&
637+
git log --use-mailmap >log &&
638+
grep Author log >actual &&
638639
test_cmp expect actual
639640
'
640641

@@ -651,7 +652,8 @@ test_expect_success 'Log output with log.mailmap' '
651652
Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
652653
EOF
653654
654-
git -c log.mailmap=True log | grep Author >actual &&
655+
git -c log.mailmap=True log >log &&
656+
grep Author log >actual &&
655657
test_cmp expect actual
656658
'
657659

@@ -665,7 +667,8 @@ test_expect_success 'log.mailmap=false disables mailmap' '
665667
Author: nick1 <[email protected]>
666668
Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
667669
EOF
668-
git -c log.mailmap=false log | grep Author >actual &&
670+
git -c log.mailmap=false log >log &&
671+
grep Author log >actual &&
669672
test_cmp expect actual
670673
'
671674

@@ -679,7 +682,8 @@ test_expect_success '--no-use-mailmap disables mailmap' '
679682
Author: nick1 <[email protected]>
680683
Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
681684
EOF
682-
git log --no-use-mailmap | grep Author > actual &&
685+
git log --no-use-mailmap >log &&
686+
grep Author log >actual &&
683687
test_cmp expect actual
684688
'
685689

@@ -690,7 +694,8 @@ test_expect_success 'Grep author with --use-mailmap' '
690694
Author: Santa Claus <[email protected]>
691695
Author: Santa Claus <[email protected]>
692696
EOF
693-
git log --use-mailmap --author Santa | grep Author >actual &&
697+
git log --use-mailmap --author Santa >log &&
698+
grep Author log >actual &&
694699
test_cmp expect actual
695700
'
696701

@@ -702,13 +707,15 @@ test_expect_success 'Grep author with log.mailmap' '
702707
Author: Santa Claus <[email protected]>
703708
EOF
704709
705-
git -c log.mailmap=True log --author Santa | grep Author >actual &&
710+
git -c log.mailmap=True log --author Santa >log &&
711+
grep Author log >actual &&
706712
test_cmp expect actual
707713
'
708714

709715
test_expect_success 'log.mailmap is true by default these days' '
710716
test_config mailmap.file complex.map &&
711-
git log --author Santa | grep Author >actual &&
717+
git log --author Santa >log &&
718+
grep Author log >actual &&
712719
test_cmp expect actual
713720
'
714721

0 commit comments

Comments
 (0)