Skip to content

Commit ce21ccf

Browse files
devzero2000gitster
authored andcommitted
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 <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6003eb1 commit ce21ccf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t4204-patch-id.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ test_expect_success 'patch-id supports git-format-patch output' '
4545
git checkout same &&
4646
git format-patch -1 --stdout | calc_patch_id same &&
4747
test_cmp patch-id_master patch-id_same &&
48-
set `git format-patch -1 --stdout | git patch-id` &&
49-
test "$2" = `git rev-parse HEAD`
48+
set $(git format-patch -1 --stdout | git patch-id) &&
49+
test "$2" = $(git rev-parse HEAD)
5050
'
5151

5252
test_expect_success 'whitespace is irrelevant in footer' '

0 commit comments

Comments
 (0)