Skip to content

Commit d262bfa

Browse files
spectre10gitster
authored andcommitted
t0024: avoid losing exit status to pipes
Replace pipe with redirection operator '>' to store the output to a temporary file after 'git archive' command since the pipe will swallow the command's exit code and a crash won't necessarily be noticed. Also fix an unwanted space after redirection '>' to match the style described in CodingGuidelines. Signed-off-by: Ghanshyam Thakkar <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 186b115 commit d262bfa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t0024-crlf-archive.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test_expect_success setup '
99
1010
git config core.autocrlf true &&
1111
12-
printf "CRLF line ending\r\nAnd another\r\n" > sample &&
12+
printf "CRLF line ending\r\nAnd another\r\n" >sample &&
1313
git add sample &&
1414
1515
test_tick &&
@@ -19,8 +19,8 @@ test_expect_success setup '
1919

2020
test_expect_success 'tar archive' '
2121
22-
git archive --format=tar HEAD |
23-
( mkdir untarred && cd untarred && "$TAR" -xf - ) &&
22+
git archive --format=tar HEAD >test.tar &&
23+
( mkdir untarred && cd untarred && "$TAR" -xf ../test.tar ) &&
2424
2525
test_cmp sample untarred/sample
2626

0 commit comments

Comments
 (0)