t/t5500-fetch-pack.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 23, 2015 at 14:45 UTC
2feed90768c911b43c5f280520cc76d3f49ae267
1 file changed
+10
-10
t/t5500-fetch-pack.sh
+10
-10
@@ -14,7 +14,7 @@ test_description='Testing multi_ack pack fetching'
14
add () {
15
name=$1 &&
16
text="$@" &&
17
- branch=`echo $name | sed -e 's/^\(.\).*$/\1/'` &&
17
+ branch=$(echo $name | sed -e 's/^\(.\).*$/\1/') &&
18
parents="" &&
19
20
shift &&
@@ -50,18 +50,18 @@ pull_to_client () {
50
case "$heads" in *B*)
51
echo $BTIP > .git/refs/heads/B;;
52
esac &&
53
- git symbolic-ref HEAD refs/heads/`echo $heads \
54
- | sed -e "s/^\(.\).*$/\1/"` &&
53
+ git symbolic-ref HEAD refs/heads/$(echo $heads \
54
+ | sed -e "s/^\(.\).*$/\1/") &&
55
56
git fsck --full &&
57
58
mv .git/objects/pack/pack-* . &&
59
- p=`ls -1 pack-*.pack` &&
59
+ p=$(ls -1 pack-*.pack) &&
60
git unpack-objects <$p &&
61
git fsck --full &&
62
63
- idx=`echo pack-*.idx` &&
64
- pack_count=`git show-index <$idx | wc -l` &&
63
+ idx=$(echo pack-*.idx) &&
64
+ pack_count=$(git show-index <$idx | wc -l) &&
65
test $pack_count = $count &&
66
rm -f pack-*
67
)
@@ -132,13 +132,13 @@ test_expect_success 'single given branch clone' '
132
133
test_expect_success 'clone shallow depth 1' '
134
git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0 &&
135
- test "`git --git-dir=shallow0/.git rev-list --count HEAD`" = 1
135
+ test "$(git --git-dir=shallow0/.git rev-list --count HEAD)" = 1
136
'
137
138
test_expect_success 'clone shallow depth 1 with fsck' '
139
git config --global fetch.fsckobjects true &&
140
git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0fsck &&
141
- test "`git --git-dir=shallow0fsck/.git rev-list --count HEAD`" = 1 &&
141
+ test "$(git --git-dir=shallow0fsck/.git rev-list --count HEAD)" = 1 &&
142
git config --global --unset fetch.fsckobjects
143
'
144
@@ -147,7 +147,7 @@ test_expect_success 'clone shallow' '
147
'
148
149
test_expect_success 'clone shallow depth count' '
150
- test "`git --git-dir=shallow/.git rev-list --count HEAD`" = 2
150
+ test "$(git --git-dir=shallow/.git rev-list --count HEAD)" = 2
151
'
152
153
test_expect_success 'clone shallow object count' '
@@ -273,7 +273,7 @@ test_expect_success 'additional simple shallow deepenings' '
273
'
274
275
test_expect_success 'clone shallow depth count' '
276
- test "`git --git-dir=shallow/.git rev-list --count HEAD`" = 11
276
+ test "$(git --git-dir=shallow/.git rev-list --count HEAD)" = 11
277
'
278
279
test_expect_success 'clone shallow object count' '