t/t1512-rev-parse-disambiguation.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> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elia Pinto committed Dec 22, 2015 at 16:05 UTC dcfbb2aa891a15fd647ca03f54093c9867ea4f44
1 file changed +4 -4
t/t1512-rev-parse-disambiguation.sh
+4 -4
@@ -275,19 +275,19 @@ test_expect_success 'rev-parse --disambiguate' '
275
276 test_expect_success 'ambiguous 40-hex ref' '
277 TREE=$(git mktree </dev/null) &&
278 - REF=`git rev-parse HEAD` &&
278 + REF=$(git rev-parse HEAD) &&
279 VAL=$(git commit-tree $TREE </dev/null) &&
280 git update-ref refs/heads/$REF $VAL &&
281 - test `git rev-parse $REF 2>err` = $REF &&
281 + test $(git rev-parse $REF 2>err) = $REF &&
282 grep "refname.*${REF}.*ambiguous" err
283 '
284
285 test_expect_success 'ambiguous short sha1 ref' '
286 TREE=$(git mktree </dev/null) &&
287 - REF=`git rev-parse --short HEAD` &&
287 + REF=$(git rev-parse --short HEAD) &&
288 VAL=$(git commit-tree $TREE </dev/null) &&
289 git update-ref refs/heads/$REF $VAL &&
290 - test `git rev-parse $REF 2>err` = $VAL &&
290 + test $(git rev-parse $REF 2>err) = $VAL &&
291 grep "refname.*${REF}.*ambiguous" err
292 '
293