Skip to content

Commit fbaff7a

Browse files
devzero2000gitster
authored andcommitted
t/t0025-crlf-auto.sh: avoid "test <cond> -a/-o <cond>"
The construct is error-prone; "test" being built-in in most modern shells, the reason to avoid "test <cond> && test <cond>" spawning one extra process by using a single "test <cond> -a <cond>" no longer exists. Signed-off-by: Elia Pinto <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ce5dadb commit fbaff7a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t0025-crlf-auto.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test_expect_success 'default settings cause no changes' '
3636
onediff=$(git diff one) &&
3737
twodiff=$(git diff two) &&
3838
threediff=$(git diff three) &&
39-
test -z "$onediff" -a -z "$twodiff" -a -z "$threediff"
39+
test -z "$onediff" && test -z "$twodiff" && test -z "$threediff"
4040
'
4141

4242
test_expect_success 'crlf=true causes a CRLF file to be normalized' '
@@ -111,7 +111,7 @@ test_expect_success 'autocrlf=true does not normalize CRLF files' '
111111
onediff=$(git diff one) &&
112112
twodiff=$(git diff two) &&
113113
threediff=$(git diff three) &&
114-
test -z "$onediff" -a -z "$twodiff" -a -z "$threediff"
114+
test -z "$onediff" && test -z "$twodiff" && test -z "$threediff"
115115
'
116116

117117
test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' '
@@ -126,7 +126,7 @@ test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' '
126126
onediff=$(git diff one) &&
127127
twodiff=$(git diff two) &&
128128
threediff=$(git diff three) &&
129-
test -z "$onediff" -a -n "$twodiff" -a -z "$threediff"
129+
test -z "$onediff" && test -n "$twodiff" && test -z "$threediff"
130130
'
131131

132132
test_expect_success 'text=auto, autocrlf=true does not normalize binary files' '

0 commit comments

Comments
 (0)