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 <liu.denton@gmail.com> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
		 Denton Liu
					Denton Liu
				
			
				
					committed by
					
						 Junio C Hamano
						Junio C Hamano
					
				
			
			
				
	
			
			
			 Junio C Hamano
						Junio C Hamano
					
				
			
						parent
						
							f9f30a0310
						
					
				
				
					commit
					afa80f534b
				
			| @ -634,7 +634,8 @@ test_expect_success 'Log output with --use-mailmap' ' | ||||
| 	Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> | ||||
| 	EOF | ||||
|  | ||||
| 	git log --use-mailmap | grep Author >actual && | ||||
| 	git log --use-mailmap >log && | ||||
| 	grep Author log >actual && | ||||
| 	test_cmp expect actual | ||||
| ' | ||||
|  | ||||
| @ -651,7 +652,8 @@ test_expect_success 'Log output with log.mailmap' ' | ||||
| 	Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> | ||||
| 	EOF | ||||
|  | ||||
| 	git -c log.mailmap=True log | grep Author >actual && | ||||
| 	git -c log.mailmap=True log >log && | ||||
| 	grep Author log >actual && | ||||
| 	test_cmp expect actual | ||||
| ' | ||||
|  | ||||
| @ -665,7 +667,8 @@ test_expect_success 'log.mailmap=false disables mailmap' ' | ||||
| 	Author: nick1 <bugs@company.xx> | ||||
| 	Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> | ||||
| 	EOF | ||||
| 	git -c log.mailmap=false log | grep Author >actual && | ||||
| 	git -c log.mailmap=false log >log && | ||||
| 	grep Author log >actual && | ||||
| 	test_cmp expect actual | ||||
| ' | ||||
|  | ||||
| @ -679,7 +682,8 @@ test_expect_success '--no-use-mailmap disables mailmap' ' | ||||
| 	Author: nick1 <bugs@company.xx> | ||||
| 	Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> | ||||
| 	EOF | ||||
| 	git log --no-use-mailmap | grep Author > actual && | ||||
| 	git log --no-use-mailmap >log && | ||||
| 	grep Author log >actual && | ||||
| 	test_cmp expect actual | ||||
| ' | ||||
|  | ||||
| @ -690,7 +694,8 @@ test_expect_success 'Grep author with --use-mailmap' ' | ||||
| 	Author: Santa Claus <santa.claus@northpole.xx> | ||||
| 	Author: Santa Claus <santa.claus@northpole.xx> | ||||
| 	EOF | ||||
| 	git log --use-mailmap --author Santa | grep Author >actual && | ||||
| 	git log --use-mailmap --author Santa >log && | ||||
| 	grep Author log >actual && | ||||
| 	test_cmp expect actual | ||||
| ' | ||||
|  | ||||
| @ -702,13 +707,15 @@ test_expect_success 'Grep author with log.mailmap' ' | ||||
| 	Author: Santa Claus <santa.claus@northpole.xx> | ||||
| 	EOF | ||||
|  | ||||
| 	git -c log.mailmap=True log --author Santa | grep Author >actual && | ||||
| 	git -c log.mailmap=True log --author Santa >log && | ||||
| 	grep Author log >actual && | ||||
| 	test_cmp expect actual | ||||
| ' | ||||
|  | ||||
| test_expect_success 'log.mailmap is true by default these days' ' | ||||
| 	test_config mailmap.file complex.map && | ||||
| 	git log --author Santa | grep Author >actual && | ||||
| 	git log --author Santa >log && | ||||
| 	grep Author log >actual && | ||||
| 	test_cmp expect actual | ||||
| ' | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user