t/t9001-send-email.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
Jan 11, 2016 at 14:34 UTC
bdf20f5edda12d5b02e7873ca9dfa831eafdd3cd
1 file changed
+6
-6
t/t9001-send-email.sh
+6
-6
@@ -36,7 +36,7 @@ clean_fake_sendmail () {
36
}
37
38
test_expect_success $PREREQ 'Extract patches' '
39
- patches=`git format-patch -s --cc="One <one@example.com>" --cc=two@example.com -n HEAD^1`
39
+ patches=$(git format-patch -s --cc="One <one@example.com>" --cc=two@example.com -n HEAD^1)
40
'
41
42
# Test no confirm early to ensure remaining tests will not hang
@@ -1151,7 +1151,7 @@ test_expect_success $PREREQ '--no-bcc overrides sendemail.bcc' '
1151
'
1152
1153
test_expect_success $PREREQ 'patches To headers are used by default' '
1154
- patch=`git format-patch -1 --to="bodies@example.com"` &&
1154
+ patch=$(git format-patch -1 --to="bodies@example.com") &&
1155
test_when_finished "rm $patch" &&
1156
git send-email \
1157
--dry-run \
@@ -1162,7 +1162,7 @@ test_expect_success $PREREQ 'patches To headers are used by default' '
1162
'
1163
1164
test_expect_success $PREREQ 'patches To headers are appended to' '
1165
- patch=`git format-patch -1 --to="bodies@example.com"` &&
1165
+ patch=$(git format-patch -1 --to="bodies@example.com") &&
1166
test_when_finished "rm $patch" &&
1167
git send-email \
1168
--dry-run \
@@ -1175,8 +1175,8 @@ test_expect_success $PREREQ 'patches To headers are appended to' '
1175
'
1176
1177
test_expect_success $PREREQ 'To headers from files reset each patch' '
1178
- patch1=`git format-patch -1 --to="bodies@example.com"` &&
1179
- patch2=`git format-patch -1 --to="other@example.com" HEAD~` &&
1178
+ patch1=$(git format-patch -1 --to="bodies@example.com") &&
1179
+ patch2=$(git format-patch -1 --to="other@example.com" HEAD~) &&
1180
test_when_finished "rm $patch1 && rm $patch2" &&
1181
git send-email \
1182
--dry-run \
@@ -1488,7 +1488,7 @@ test_cover_addresses () {
1488
clean_fake_sendmail &&
1489
rm -fr outdir &&
1490
git format-patch --cover-letter -2 -o outdir &&
1491
- cover=`echo outdir/0000-*.patch` &&
1491
+ cover=$(echo outdir/0000-*.patch) &&
1492
mv $cover cover-to-edit.patch &&
1493
perl -pe "s/^From:/$header: extra\@address.com\nFrom:/" cover-to-edit.patch >"$cover" &&
1494
git send-email \