t9130-git-svn-authors-file.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 11:49 UTC
a5c98acec6ad8e8c397b1001621a4edfacc98516
1 file changed
+6
-6
t/t9130-git-svn-authors-file.sh
+6
-6
@@ -26,7 +26,7 @@ test_expect_success 'start import with incomplete authors file' '
26
test_expect_success 'imported 2 revisions successfully' '
27
(
28
cd x
29
- test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 2 &&
29
+ test "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 2 &&
30
git rev-list -1 --pretty=raw refs/remotes/git-svn | \
31
grep "^author BBBBBBB BBBBBBB <bb@example\.com> " &&
32
git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
@@ -43,7 +43,7 @@ test_expect_success 'continues to import once authors have been added' '
43
(
44
cd x
45
git svn fetch --authors-file=../svn-authors &&
46
- test "`git rev-list refs/remotes/git-svn | wc -l`" -eq 4 &&
46
+ test "$(git rev-list refs/remotes/git-svn | wc -l)" -eq 4 &&
47
git rev-list -1 --pretty=raw refs/remotes/git-svn | \
48
grep "^author DDDDDDD DDDDDDD <dd@example\.com> " &&
49
git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
@@ -73,8 +73,8 @@ tmp_config_get () {
73
test_expect_success 'failure happened without negative side effects' '
74
(
75
cd aa-work &&
76
- test 6 -eq "`tmp_config_get svn-remote.svn.branches-maxRev`" &&
77
- test 6 -eq "`tmp_config_get svn-remote.svn.tags-maxRev`"
76
+ test 6 -eq "$(tmp_config_get svn-remote.svn.branches-maxRev)" &&
77
+ test 6 -eq "$(tmp_config_get svn-remote.svn.tags-maxRev)"
78
)
79
'
80
@@ -86,8 +86,8 @@ test_expect_success 'fetch continues after authors-file is fixed' '
86
(
87
cd aa-work &&
88
git svn fetch --authors-file=../svn-authors &&
89
- test 8 -eq "`tmp_config_get svn-remote.svn.branches-maxRev`" &&
90
- test 8 -eq "`tmp_config_get svn-remote.svn.tags-maxRev`"
89
+ test 8 -eq "$(tmp_config_get svn-remote.svn.branches-maxRev)" &&
90
+ test 8 -eq "$(tmp_config_get svn-remote.svn.tags-maxRev)"
91
)
92
'
93