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>
Boxuan Li committed
May 5, 2019 at 16:16 UTC
ce4c7bfc90d93bdbf979d756c03c52d2d6b286d4
1 file changed
+4
-2
t/t4253-am-keep-cr-dos.sh
+4
-2
@@ -51,14 +51,16 @@ test_expect_success 'am with dos files without --keep-cr' '
51
52
test_expect_success 'am with dos files with --keep-cr' '
53
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 &&
56
git diff --exit-code master
57
'
58
59
test_expect_success 'am with dos files config am.keepcr' '
60
git config am.keepcr 1 &&
61
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 &&
64
git diff --exit-code master
65
'
66