Skip to content

Commit ce4c7bf

Browse files
li-boxuangitster
authored andcommitted
t4253-am-keep-cr-dos: avoid using pipes
The exit code of the upstream in a pipe is ignored thus we should avoid using it. By writing out the output of the git command to a file, we can test the exit codes of both the commands. Signed-off-by: Boxuan Li <liboxuan@connect.hku.hk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent aeb582a commit ce4c7bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/t4253-am-keep-cr-dos.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@ test_expect_success 'am with dos files without --keep-cr' '
5151

5252
test_expect_success 'am with dos files with --keep-cr' '
5353
git checkout -b dosfiles-keep-cr initial &&
54-
git format-patch -k --stdout initial..master | git am --keep-cr -k -3 &&
54+
git format-patch -k --stdout initial..master >output &&
55+
git am --keep-cr -k -3 output &&
5556
git diff --exit-code master
5657
'
5758

5859
test_expect_success 'am with dos files config am.keepcr' '
5960
git config am.keepcr 1 &&
6061
git checkout -b dosfiles-conf-keepcr initial &&
61-
git format-patch -k --stdout initial..master | git am -k -3 &&
62+
git format-patch -k --stdout initial..master >output &&
63+
git am -k -3 output &&
6264
git diff --exit-code master
6365
'
6466

0 commit comments

Comments
 (0)