Skip to content

Commit 66e1fe7

Browse files
devzero2000gitster
authored andcommitted
t/t0026-eol-config.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 fbaff7a commit 66e1fe7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t0026-eol-config.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test_expect_success 'eol=lf puts LFs in normalized file' '
3636
! has_cr two &&
3737
onediff=$(git diff one) &&
3838
twodiff=$(git diff two) &&
39-
test -z "$onediff" -a -z "$twodiff"
39+
test -z "$onediff" && test -z "$twodiff"
4040
'
4141

4242
test_expect_success 'eol=crlf puts CRLFs in normalized file' '
@@ -49,7 +49,7 @@ test_expect_success 'eol=crlf puts CRLFs in normalized file' '
4949
! has_cr two &&
5050
onediff=$(git diff one) &&
5151
twodiff=$(git diff two) &&
52-
test -z "$onediff" -a -z "$twodiff"
52+
test -z "$onediff" && test -z "$twodiff"
5353
'
5454

5555
test_expect_success 'autocrlf=true overrides eol=lf' '
@@ -63,7 +63,7 @@ test_expect_success 'autocrlf=true overrides eol=lf' '
6363
has_cr two &&
6464
onediff=$(git diff one) &&
6565
twodiff=$(git diff two) &&
66-
test -z "$onediff" -a -z "$twodiff"
66+
test -z "$onediff" && test -z "$twodiff"
6767
'
6868

6969
test_expect_success 'autocrlf=true overrides unset eol' '
@@ -77,7 +77,7 @@ test_expect_success 'autocrlf=true overrides unset eol' '
7777
has_cr two &&
7878
onediff=$(git diff one) &&
7979
twodiff=$(git diff two) &&
80-
test -z "$onediff" -a -z "$twodiff"
80+
test -z "$onediff" && test -z "$twodiff"
8181
'
8282

8383
test_done

0 commit comments

Comments
 (0)