t4014-format-patch.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 30, 2014 at 09:23 UTC 54835fc57ea16ed19d1689b37073806537f14cf7
1 file changed +5 -5
t/t4014-format-patch.sh
+5 -5
@@ -43,7 +43,7 @@ test_expect_success setup '
43 test_expect_success "format-patch --ignore-if-in-upstream" '
44
45 git format-patch --stdout master..side >patch0 &&
46 - cnt=`grep "^From " patch0 | wc -l` &&
46 + cnt=$(grep "^From " patch0 | wc -l) &&
47 test $cnt = 3
48
49 '
@@ -52,7 +52,7 @@ test_expect_success "format-patch --ignore-if-in-upstream" '
52
53 git format-patch --stdout \
54 --ignore-if-in-upstream master..side >patch1 &&
55 - cnt=`grep "^From " patch1 | wc -l` &&
55 + cnt=$(grep "^From " patch1 | wc -l) &&
56 test $cnt = 2
57
58 '
@@ -69,7 +69,7 @@ test_expect_success "format-patch doesn't consider merge commits" '
69 git checkout -b merger master &&
70 test_tick &&
71 git merge --no-ff slave &&
72 - cnt=`git format-patch -3 --stdout | grep "^From " | wc -l` &&
72 + cnt=$(git format-patch -3 --stdout | grep "^From " | wc -l) &&
73 test $cnt = 3
74 '
75
@@ -77,7 +77,7 @@ test_expect_success "format-patch result applies" '
77
78 git checkout -b rebuild-0 master &&
79 git am -3 patch0 &&
80 - cnt=`git rev-list master.. | wc -l` &&
80 + cnt=$(git rev-list master.. | wc -l) &&
81 test $cnt = 2
82 '
83
@@ -85,7 +85,7 @@ test_expect_success "format-patch --ignore-if-in-upstream result applies" '
85
86 git checkout -b rebuild-1 master &&
87 git am -3 patch1 &&
88 - cnt=`git rev-list master.. | wc -l` &&
88 + cnt=$(git rev-list master.. | wc -l) &&
89 test $cnt = 2
90 '
91