t/t5301-sliding-window.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 Dec 22, 2015 at 16:27 UTC 046dec74afe7a4bc2848b8cf73e3c4751382ef8e
1 file changed +7 -7
t/t5301-sliding-window.sh
+7 -7
@@ -16,12 +16,12 @@ test_expect_success \
16 git update-index --add $i || return 1
17 done &&
18 echo d >d && cat c >>d && git update-index --add d &&
19 - tree=`git write-tree` &&
20 - commit1=`git commit-tree $tree </dev/null` &&
19 + tree=$(git write-tree) &&
20 + commit1=$(git commit-tree $tree </dev/null) &&
21 git update-ref HEAD $commit1 &&
22 git repack -a -d &&
23 - test "`git count-objects`" = "0 objects, 0 kilobytes" &&
24 - pack1=`ls .git/objects/pack/*.pack` &&
23 + test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
24 + pack1=$(ls .git/objects/pack/*.pack) &&
25 test -f "$pack1"'
26
27 test_expect_success \
@@ -43,11 +43,11 @@ test_expect_success \
43 'repack -a -d, packedGit{WindowSize,Limit} == 1 page' \
44 'git config core.packedGitWindowSize 512 &&
45 git config core.packedGitLimit 512 &&
46 - commit2=`git commit-tree $tree -p $commit1 </dev/null` &&
46 + commit2=$(git commit-tree $tree -p $commit1 </dev/null) &&
47 git update-ref HEAD $commit2 &&
48 git repack -a -d &&
49 - test "`git count-objects`" = "0 objects, 0 kilobytes" &&
50 - pack2=`ls .git/objects/pack/*.pack` &&
49 + test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
50 + pack2=$(ls .git/objects/pack/*.pack) &&
51 test -f "$pack2" &&
52 test "$pack1" \!= "$pack2"'
53