t/t5300-pack-object.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 22, 2015 at 16:27 UTC
d6cd9ac905e268eba111798abc69c1ea1de648aa
1 file changed
+9
-9
t/t5300-pack-object.sh
+9
-9
@@ -8,7 +8,7 @@ test_description='git pack-object
8
'
9
. ./test-lib.sh
10
11
-TRASH=`pwd`
11
+TRASH=$(pwd)
12
13
test_expect_success \
14
'setup' \
@@ -20,8 +20,8 @@ test_expect_success \
20
test-genrandom "seed b" 2097152 > b_big &&
21
git update-index --add a a_big b b_big c &&
22
cat c >d && echo foo >>d && git update-index --add d &&
23
- tree=`git write-tree` &&
24
- commit=`git commit-tree $tree </dev/null` && {
23
+ tree=$(git write-tree) &&
24
+ commit=$(git commit-tree $tree </dev/null) && {
25
echo $tree &&
26
echo $commit &&
27
git ls-tree $tree | sed -e "s/.* \\([0-9a-f]*\\) .*/\\1/"
@@ -29,7 +29,7 @@ test_expect_success \
29
git diff-tree --root -p $commit &&
30
while read object
31
do
32
- t=`git cat-file -t $object` &&
32
+ t=$(git cat-file -t $object) &&
33
git cat-file $t $object || return 1
34
done <obj-list
35
} >expect'
@@ -147,7 +147,7 @@ test_expect_success \
147
git diff-tree --root -p $commit &&
148
while read object
149
do
150
- t=`git cat-file -t $object` &&
150
+ t=$(git cat-file -t $object) &&
151
git cat-file $t $object || return 1
152
done <obj-list
153
} >current &&
@@ -162,7 +162,7 @@ test_expect_success \
162
git diff-tree --root -p $commit &&
163
while read object
164
do
165
- t=`git cat-file -t $object` &&
165
+ t=$(git cat-file -t $object) &&
166
git cat-file $t $object || return 1
167
done <obj-list
168
} >current &&
@@ -177,7 +177,7 @@ test_expect_success \
177
git diff-tree --root -p $commit &&
178
while read object
179
do
180
- t=`git cat-file -t $object` &&
180
+ t=$(git cat-file -t $object) &&
181
git cat-file $t $object || return 1
182
done <obj-list
183
} >current &&
@@ -252,8 +252,8 @@ test_expect_success \
252
253
test_expect_success \
254
'verify-pack catches a corrupted sum of the index file itself' \
255
- 'l=`wc -c <test-3.idx` &&
256
- l=`expr $l - 20` &&
255
+ 'l=$(wc -c <test-3.idx) &&
256
+ l=$(expr $l - 20) &&
257
cat test-1-${packname_1}.pack >test-3.pack &&
258
printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
259
if git verify-pack test-3.pack