Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 3e86741

Browse files
devzero2000gitster
authored andcommitted
git-fetch.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 sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. Signed-off-by: Elia Pinto <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 346b54d commit 3e86741

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/examples/git-fetch.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ do
6767
keep='-k -k'
6868
;;
6969
--depth=*)
70-
shallow_depth="--depth=`expr "z$1" : 'z-[^=]*=\(.*\)'`"
70+
shallow_depth="--depth=$(expr "z$1" : 'z-[^=]*=\(.*\)')"
7171
;;
7272
--depth)
7373
shift
@@ -262,12 +262,12 @@ fetch_per_ref () {
262262
http://* | https://* | ftp://*)
263263
test -n "$shallow_depth" &&
264264
die "shallow clone with http not supported"
265-
proto=`expr "$remote" : '\([^:]*\):'`
265+
proto=$(expr "$remote" : '\([^:]*\):')
266266
if [ -n "$GIT_SSL_NO_VERIFY" ]; then
267267
curl_extra_args="-k"
268268
fi
269269
if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
270-
"`git config --bool http.noEPSV`" = true ]; then
270+
"$(git config --bool http.noEPSV)" = true ]; then
271271
noepsv_opt="--disable-epsv"
272272
fi
273273

0 commit comments

Comments
 (0)