t9107-git-svn-migrate.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 12, 2016 at 10:45 UTC 8823d2fa792efbc89d3ab1392a4b064e8fbd6705
1 file changed +14 -14
t/t9107-git-svn-migrate.sh
+14 -14
@@ -24,10 +24,10 @@ test_expect_success 'setup old-looking metadata' '
24 git update-ref -d refs/${remotes_git_svn} refs/${remotes_git_svn}
25 '
26
27 -head=`git rev-parse --verify refs/heads/git-svn-HEAD^0`
27 +head=$(git rev-parse --verify refs/heads/git-svn-HEAD^0)
28 test_expect_success 'git-svn-HEAD is a real HEAD' "test -n '$head'"
29
30 -svnrepo_escaped=`echo $svnrepo | sed 's/ /%20/'`
30 +svnrepo_escaped=$(echo $svnrepo | sed 's/ /%20/')
31
32 test_expect_success 'initialize old-style (v0) git svn layout' '
33 mkdir -p "$GIT_DIR"/git-svn/info "$GIT_DIR"/svn/info &&
@@ -38,7 +38,7 @@ test_expect_success 'initialize old-style (v0) git svn layout' '
38 git rev-parse --verify refs/${remotes_git_svn}^0 &&
39 git rev-parse --verify refs/remotes/svn^0 &&
40 test "$(git config --get svn-remote.svn.url)" = "$svnrepo_escaped" &&
41 - test `git config --get svn-remote.svn.fetch` = \
41 + test $(git config --get svn-remote.svn.fetch) = \
42 ":refs/${remotes_git_svn}"
43 '
44
@@ -46,10 +46,10 @@ test_expect_success 'initialize a multi-repository repo' '
46 git svn init "$svnrepo" -T trunk -t tags -b branches &&
47 git config --get-all svn-remote.svn.fetch > fetch.out &&
48 grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
49 - test -n "`git config --get svn-remote.svn.branches \
50 - "^branches/\*:refs/remotes/origin/\*$"`" &&
51 - test -n "`git config --get svn-remote.svn.tags \
52 - "^tags/\*:refs/remotes/origin/tags/\*$"`" &&
49 + test -n "$(git config --get svn-remote.svn.branches \
50 + "^branches/\*:refs/remotes/origin/\*$")" &&
51 + test -n "$(git config --get svn-remote.svn.tags \
52 + "^tags/\*:refs/remotes/origin/tags/\*$")" &&
53 git config --unset svn-remote.svn.branches \
54 "^branches/\*:refs/remotes/origin/\*$" &&
55 git config --unset svn-remote.svn.tags \
@@ -75,28 +75,28 @@ test_expect_success 'multi-fetch works on partial urls + paths' "
75 for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
76 git rev-parse --verify refs/remotes/origin/\$i^0 >> refs.out || exit 1;
77 done &&
78 - test -z \"\`sort < refs.out | uniq -d\`\" &&
78 + test -z \"\$(sort < refs.out | uniq -d)\" &&
79 for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
80 for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do
81 if test \$j != \$i; then continue; fi
82 - test -z \"\`git diff refs/remotes/origin/\$i \
83 - refs/remotes/origin/\$j\`\" ||exit 1; done; done
82 + test -z \"\$(git diff refs/remotes/origin/\$i \
83 + refs/remotes/origin/\$j)\" ||exit 1; done; done
84 "
85
86 test_expect_success 'migrate --minimize on old inited layout' '
87 git config --unset-all svn-remote.svn.fetch &&
88 git config --unset-all svn-remote.svn.url &&
89 rm -rf "$GIT_DIR"/svn &&
90 - for i in `cat fetch.out`; do
91 - path=`expr $i : "\([^:]*\):.*$"`
92 - ref=`expr $i : "[^:]*:\(refs/remotes/.*\)$"`
90 + for i in $(cat fetch.out); do
91 + path=$(expr $i : "\([^:]*\):.*$")
92 + ref=$(expr $i : "[^:]*:\(refs/remotes/.*\)$")
93 if test -z "$ref"; then continue; fi
94 if test -n "$path"; then path="/$path"; fi
95 ( mkdir -p "$GIT_DIR"/svn/$ref/info/ &&
96 echo "$svnrepo"$path > "$GIT_DIR"/svn/$ref/info/url ) || exit 1;
97 done &&
98 git svn migrate --minimize &&
99 - test -z "`git config -l | grep "^svn-remote\.git-svn\."`" &&
99 + test -z "$(git config -l | grep "^svn-remote\.git-svn\.")" &&
100 git config --get-all svn-remote.svn.fetch > fetch.out &&
101 grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
102 grep "^branches/a:refs/remotes/origin/a$" fetch.out &&