t0025-crlf-auto.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command substitution instead of using the backquotes `...`. The backquoted form is the traditional method for command substitution, and is supported by POSIX. However, all but the simplest uses become complicated quickly. In particular, embedded command substitutions and/or the use of double quotes require careful escaping with the backslash character. The patch was generated by: for _f in $(find . -name "*.sh") do sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. 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>

Elia Pinto committed Apr 28, 2014 at 05:57 UTC 0bf6414996d5acbefaaf808ec417c45661981bd0
1 file changed +19 -19
t/t0025-crlf-auto.sh
+19 -19
@@ -19,9 +19,9 @@ test_expect_success setup '
19
20 git commit -m initial &&
21
22 - one=`git rev-parse HEAD:one` &&
23 - two=`git rev-parse HEAD:two` &&
24 - three=`git rev-parse HEAD:three` &&
22 + one=$(git rev-parse HEAD:one) &&
23 + two=$(git rev-parse HEAD:two) &&
24 + three=$(git rev-parse HEAD:three) &&
25
26 echo happy.
27 '
@@ -33,9 +33,9 @@ test_expect_success 'default settings cause no changes' '
33
34 ! has_cr one &&
35 has_cr two &&
36 - onediff=`git diff one` &&
37 - twodiff=`git diff two` &&
38 - threediff=`git diff three` &&
36 + onediff=$(git diff one) &&
37 + twodiff=$(git diff two) &&
38 + threediff=$(git diff three) &&
39 test -z "$onediff" -a -z "$twodiff" -a -z "$threediff"
40 '
41
@@ -48,7 +48,7 @@ test_expect_success 'crlf=true causes a CRLF file to be normalized' '
48
49 # Note, "normalized" means that git will normalize it if added
50 has_cr two &&
51 - twodiff=`git diff two` &&
51 + twodiff=$(git diff two) &&
52 test -n "$twodiff"
53 '
54
@@ -60,7 +60,7 @@ test_expect_success 'text=true causes a CRLF file to be normalized' '
60
61 # Note, "normalized" means that git will normalize it if added
62 has_cr two &&
63 - twodiff=`git diff two` &&
63 + twodiff=$(git diff two) &&
64 test -n "$twodiff"
65 '
66
@@ -72,7 +72,7 @@ test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=false'
72 git read-tree --reset -u HEAD &&
73
74 has_cr one &&
75 - onediff=`git diff one` &&
75 + onediff=$(git diff one) &&
76 test -z "$onediff"
77 '
78
@@ -84,7 +84,7 @@ test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=input'
84 git read-tree --reset -u HEAD &&
85
86 has_cr one &&
87 - onediff=`git diff one` &&
87 + onediff=$(git diff one) &&
88 test -z "$onediff"
89 '
90
@@ -96,7 +96,7 @@ test_expect_success 'eol=lf gives a normalized file LFs with autocrlf=true' '
96 git read-tree --reset -u HEAD &&
97
98 ! has_cr one &&
99 - onediff=`git diff one` &&
99 + onediff=$(git diff one) &&
100 test -z "$onediff"
101 '
102
@@ -108,9 +108,9 @@ test_expect_success 'autocrlf=true does not normalize CRLF files' '
108
109 has_cr one &&
110 has_cr two &&
111 - onediff=`git diff one` &&
112 - twodiff=`git diff two` &&
113 - threediff=`git diff three` &&
111 + onediff=$(git diff one) &&
112 + twodiff=$(git diff two) &&
113 + threediff=$(git diff three) &&
114 test -z "$onediff" -a -z "$twodiff" -a -z "$threediff"
115 '
116
@@ -123,9 +123,9 @@ test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' '
123
124 has_cr one &&
125 has_cr two &&
126 - onediff=`git diff one` &&
127 - twodiff=`git diff two` &&
128 - threediff=`git diff three` &&
126 + onediff=$(git diff one) &&
127 + twodiff=$(git diff two) &&
128 + threediff=$(git diff three) &&
129 test -z "$onediff" -a -n "$twodiff" -a -z "$threediff"
130 '
131
@@ -137,7 +137,7 @@ test_expect_success 'text=auto, autocrlf=true does not normalize binary files' '
137 git read-tree --reset -u HEAD &&
138
139 ! has_cr three &&
140 - threediff=`git diff three` &&
140 + threediff=$(git diff three) &&
141 test -z "$threediff"
142 '
143
@@ -148,7 +148,7 @@ test_expect_success 'eol=crlf _does_ normalize binary files' '
148 git read-tree --reset -u HEAD &&
149
150 has_cr three &&
151 - threediff=`git diff three` &&
151 + threediff=$(git diff three) &&
152 test -z "$threediff"
153 '
154