t/t5570-git-daemon.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 4, 2016 at 10:10 UTC c747cf33baa6d3c161537393882b72d2cd50ed36
1 file changed +4 -4
t/t5570-git-daemon.sh
+4 -4
@@ -57,7 +57,7 @@ test_expect_success 'prepare pack objects' '
57 test_expect_success 'fetch notices corrupt pack' '
58 cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
59 (cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
60 - p=`ls objects/pack/pack-*.pack` &&
60 + p=$(ls objects/pack/pack-*.pack) &&
61 chmod u+w $p &&
62 printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
63 ) &&
@@ -65,14 +65,14 @@ test_expect_success 'fetch notices corrupt pack' '
65 (cd repo_bad1.git &&
66 git --bare init &&
67 test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad1.git" &&
68 - test 0 = `ls objects/pack/pack-*.pack | wc -l`
68 + test 0 = $(ls objects/pack/pack-*.pack | wc -l)
69 )
70 '
71
72 test_expect_success 'fetch notices corrupt idx' '
73 cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
74 (cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
75 - p=`ls objects/pack/pack-*.idx` &&
75 + p=$(ls objects/pack/pack-*.idx) &&
76 chmod u+w $p &&
77 printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
78 ) &&
@@ -80,7 +80,7 @@ test_expect_success 'fetch notices corrupt idx' '
80 (cd repo_bad2.git &&
81 git --bare init &&
82 test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad2.git" &&
83 - test 0 = `ls objects/pack | wc -l`
83 + test 0 = $(ls objects/pack | wc -l)
84 )
85 '
86