t0026-eol-config.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
8deeab4a2413868b44fda4a0d0c56d2a7c45c6be
1 file changed
+10
-10
t/t0026-eol-config.sh
+10
-10
@@ -20,8 +20,8 @@ test_expect_success setup '
20
21
git commit -m initial &&
22
23
- one=`git rev-parse HEAD:one` &&
24
- two=`git rev-parse HEAD:two` &&
23
+ one=$(git rev-parse HEAD:one) &&
24
+ two=$(git rev-parse HEAD:two) &&
25
26
echo happy.
27
'
@@ -34,8 +34,8 @@ test_expect_success 'eol=lf puts LFs in normalized file' '
34
35
! has_cr one &&
36
! has_cr two &&
37
- onediff=`git diff one` &&
38
- twodiff=`git diff two` &&
37
+ onediff=$(git diff one) &&
38
+ twodiff=$(git diff two) &&
39
test -z "$onediff" -a -z "$twodiff"
40
'
41
@@ -47,8 +47,8 @@ test_expect_success 'eol=crlf puts CRLFs in normalized file' '
47
48
has_cr one &&
49
! has_cr two &&
50
- onediff=`git diff one` &&
51
- twodiff=`git diff two` &&
50
+ onediff=$(git diff one) &&
51
+ twodiff=$(git diff two) &&
52
test -z "$onediff" -a -z "$twodiff"
53
'
54
@@ -61,8 +61,8 @@ test_expect_success 'autocrlf=true overrides eol=lf' '
61
62
has_cr one &&
63
has_cr two &&
64
- onediff=`git diff one` &&
65
- twodiff=`git diff two` &&
64
+ onediff=$(git diff one) &&
65
+ twodiff=$(git diff two) &&
66
test -z "$onediff" -a -z "$twodiff"
67
'
68
@@ -75,8 +75,8 @@ test_expect_success 'autocrlf=true overrides unset eol' '
75
76
has_cr one &&
77
has_cr two &&
78
- onediff=`git diff one` &&
79
- twodiff=`git diff two` &&
78
+ onediff=$(git diff one) &&
79
+ twodiff=$(git diff two) &&
80
test -z "$onediff" -a -z "$twodiff"
81
'
82