t9501-gitweb-standalone-http-status.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 12, 2016 at 11:49 UTC
9c1037751c0204c494b1ed49e8c1d94429ea78b1
1 file changed
+3
-3
t/t9501-gitweb-standalone-http-status.sh
+3
-3
@@ -100,14 +100,14 @@ test_expect_success 'snapshots: bad tree-ish id (tagged object)' '
100
echo object > tag-object &&
101
git add tag-object &&
102
test_tick && git commit -m "Object to be tagged" &&
103
- git tag tagged-object `git hash-object tag-object` &&
103
+ git tag tagged-object $(git hash-object tag-object) &&
104
gitweb_run "p=.git;a=snapshot;h=tagged-object;sf=tgz" &&
105
grep "400 - Object is not a tree-ish" gitweb.output
106
'
107
test_debug 'cat gitweb.output'
108
109
test_expect_success 'snapshots: good object id' '
110
- ID=`git rev-parse --verify HEAD` &&
110
+ ID=$(git rev-parse --verify HEAD) &&
111
gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
112
grep "Status: 200 OK" gitweb.output
113
'
@@ -173,7 +173,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (unmod
173
test_debug 'cat gitweb.headers'
174
175
test_expect_success DATE_PARSER 'modification: tree snapshot' '
176
- ID=`git rev-parse --verify HEAD^{tree}` &&
176
+ ID=$(git rev-parse --verify HEAD^{tree}) &&
177
HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
178
export HTTP_IF_MODIFIED_SINCE &&
179
test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&