t4204-patch-id.sh: use the $( ... ) construct for command substitution
authorElia Pinto <gitter.spiros@gmail.com>
Wed, 30 Apr 2014 16:23:06 +0000 (09:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Apr 2014 18:08:09 +0000 (11:08 -0700)
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>
t/t4204-patch-id.sh
index d2c930de87f721a0e876351e511295ae0b094108..7940f6f0b952b5accd3f1263f08e131a018de140 100755 (executable)
@@ -45,8 +45,8 @@ test_expect_success 'patch-id supports git-format-patch output' '
        git checkout same &&
        git format-patch -1 --stdout | calc_patch_id same &&
        test_cmp patch-id_master patch-id_same &&
-       set `git format-patch -1 --stdout | git patch-id` &&
-       test "$2" = `git rev-parse HEAD`
+       set $(git format-patch -1 --stdout | git patch-id) &&
+       test "$2" = $(git rev-parse HEAD)
 '
 
 test_expect_success 'whitespace is irrelevant in footer' '