From: Elia Pinto Date: Wed, 30 Apr 2014 16:23:06 +0000 (-0700) Subject: t4204-patch-id.sh: use the $( ... ) construct for command substitution X-Git-Tag: v2.1.0-rc0~184^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ce21ccfae0729fd73b54f3ae4935fc7769343561 t4204-patch-id.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 sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. Signed-off-by: Elia Pinto Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh index d2c930de87..7940f6f0b9 100755 --- a/t/t4204-patch-id.sh +++ b/t/t4204-patch-id.sh @@ -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' '