Skip to content

Commit

Permalink
t/t0025-crlf-auto.sh: avoid "test <cond> -a/-o <cond>"
Browse files Browse the repository at this point in the history
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 <gitter.spiros@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Elia Pinto authored and Junio C Hamano committed Jun 9, 2014
1 parent ce5dadb commit fbaff7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions t/t0025-crlf-auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test_expect_success 'default settings cause no changes' '
onediff=$(git diff one) &&
twodiff=$(git diff two) &&
threediff=$(git diff three) &&
test -z "$onediff" -a -z "$twodiff" -a -z "$threediff"
test -z "$onediff" && test -z "$twodiff" && test -z "$threediff"
'

test_expect_success 'crlf=true causes a CRLF file to be normalized' '
Expand Down Expand Up @@ -111,7 +111,7 @@ test_expect_success 'autocrlf=true does not normalize CRLF files' '
onediff=$(git diff one) &&
twodiff=$(git diff two) &&
threediff=$(git diff three) &&
test -z "$onediff" -a -z "$twodiff" -a -z "$threediff"
test -z "$onediff" && test -z "$twodiff" && test -z "$threediff"
'

test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' '
Expand All @@ -126,7 +126,7 @@ test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' '
onediff=$(git diff one) &&
twodiff=$(git diff two) &&
threediff=$(git diff three) &&
test -z "$onediff" -a -n "$twodiff" -a -z "$threediff"
test -z "$onediff" && test -n "$twodiff" && test -z "$threediff"
'

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

0 comments on commit fbaff7a

Please sign in to comment.