t/t3511-cherry-pick-x.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 perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}" done and then carefully proof-read. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elia Pinto committed
Dec 22, 2015 at 16:27 UTC
9b4950899aa6a910644d35c2b6cd475d83c7af17
1 file changed
+7
-7
t/t3511-cherry-pick-x.sh
+7
-7
@@ -77,7 +77,7 @@ test_expect_success setup '
77
78
test_expect_success 'cherry-pick -x inserts blank line after one line subject' '
79
pristine_detach initial &&
80
- sha1=`git rev-parse mesg-one-line^0` &&
80
+ sha1=$(git rev-parse mesg-one-line^0) &&
81
git cherry-pick -x mesg-one-line &&
82
cat <<-EOF >expect &&
83
$mesg_one_line
@@ -114,7 +114,7 @@ test_expect_success 'cherry-pick -s inserts blank line after non-conforming foot
114
115
test_expect_success 'cherry-pick -x inserts blank line when conforming footer not found' '
116
pristine_detach initial &&
117
- sha1=`git rev-parse mesg-no-footer^0` &&
117
+ sha1=$(git rev-parse mesg-no-footer^0) &&
118
git cherry-pick -x mesg-no-footer &&
119
cat <<-EOF >expect &&
120
$mesg_no_footer
@@ -139,7 +139,7 @@ test_expect_success 'cherry-pick -s inserts blank line when conforming footer no
139
140
test_expect_success 'cherry-pick -x -s inserts blank line when conforming footer not found' '
141
pristine_detach initial &&
142
- sha1=`git rev-parse mesg-no-footer^0` &&
142
+ sha1=$(git rev-parse mesg-no-footer^0) &&
143
git cherry-pick -x -s mesg-no-footer &&
144
cat <<-EOF >expect &&
145
$mesg_no_footer
@@ -164,7 +164,7 @@ test_expect_success 'cherry-pick -s adds sob when last sob doesnt match committe
164
165
test_expect_success 'cherry-pick -x -s adds sob when last sob doesnt match committer' '
166
pristine_detach initial &&
167
- sha1=`git rev-parse mesg-with-footer^0` &&
167
+ sha1=$(git rev-parse mesg-with-footer^0) &&
168
git cherry-pick -x -s mesg-with-footer &&
169
cat <<-EOF >expect &&
170
$mesg_with_footer
@@ -187,7 +187,7 @@ test_expect_success 'cherry-pick -s refrains from adding duplicate trailing sob'
187
188
test_expect_success 'cherry-pick -x -s adds sob even when trailing sob exists for committer' '
189
pristine_detach initial &&
190
- sha1=`git rev-parse mesg-with-footer-sob^0` &&
190
+ sha1=$(git rev-parse mesg-with-footer-sob^0) &&
191
git cherry-pick -x -s mesg-with-footer-sob &&
192
cat <<-EOF >expect &&
193
$mesg_with_footer_sob
@@ -200,7 +200,7 @@ test_expect_success 'cherry-pick -x -s adds sob even when trailing sob exists fo
200
201
test_expect_success 'cherry-pick -x treats "(cherry picked from..." line as part of footer' '
202
pristine_detach initial &&
203
- sha1=`git rev-parse mesg-with-cherry-footer^0` &&
203
+ sha1=$(git rev-parse mesg-with-cherry-footer^0) &&
204
git cherry-pick -x mesg-with-cherry-footer &&
205
cat <<-EOF >expect &&
206
$mesg_with_cherry_footer
@@ -223,7 +223,7 @@ test_expect_success 'cherry-pick -s treats "(cherry picked from..." line as part
223
224
test_expect_success 'cherry-pick -x -s treats "(cherry picked from..." line as part of footer' '
225
pristine_detach initial &&
226
- sha1=`git rev-parse mesg-with-cherry-footer^0` &&
226
+ sha1=$(git rev-parse mesg-with-cherry-footer^0) &&
227
git cherry-pick -x -s mesg-with-cherry-footer &&
228
cat <<-EOF >expect &&
229
$mesg_with_cherry_footer