t/t5537-fetch-shallow.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
e3a75be3fe225429e3ee6a8f2ad865dc9f3c69e9
1 file changed
+2
-2
t/t5537-fetch-shallow.sh
+2
-2
@@ -98,7 +98,7 @@ EOF
98
test_expect_success 'fetch something upstream has but hidden by clients shallow boundaries' '
99
# the blob "1" is available in .git but hidden by the
100
# shallow2/.git/shallow and it should be resent
101
- ! git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` >/dev/null &&
101
+ ! git --git-dir=shallow2/.git cat-file blob $(echo 1|git hash-object --stdin) >/dev/null &&
102
echo 1 >1.t &&
103
git add 1.t &&
104
git commit -m add-1-back &&
@@ -114,7 +114,7 @@ add-1-back
114
EOF
115
test_cmp expect actual
116
) &&
117
- git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` >/dev/null
117
+ git --git-dir=shallow2/.git cat-file blob $(echo 1|git hash-object --stdin) >/dev/null
118
119
'
120