t/t5510-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 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
a9d32be4d28d8f1d0d82788ffd1c3bd6de82931e
1 file changed
+5
-5
t/t5510-fetch.sh
+5
-5
@@ -7,7 +7,7 @@ test_description='Per branch config variables affects "git fetch".
7
8
. ./test-lib.sh
9
10
-D=`pwd`
10
+D=$(pwd)
11
12
test_bundle_object_count () {
13
git verify-pack -v "$1" >verify.out &&
@@ -64,8 +64,8 @@ test_expect_success "fetch test" '
64
cd two &&
65
git fetch &&
66
test -f .git/refs/heads/one &&
67
- mine=`git rev-parse refs/heads/one` &&
68
- his=`cd ../one && git rev-parse refs/heads/master` &&
67
+ mine=$(git rev-parse refs/heads/one) &&
68
+ his=$(cd ../one && git rev-parse refs/heads/master) &&
69
test "z$mine" = "z$his"
70
'
71
@@ -75,8 +75,8 @@ test_expect_success "fetch test for-merge" '
75
git fetch &&
76
test -f .git/refs/heads/two &&
77
test -f .git/refs/heads/one &&
78
- master_in_two=`cd ../two && git rev-parse master` &&
79
- one_in_two=`cd ../two && git rev-parse one` &&
78
+ master_in_two=$(cd ../two && git rev-parse master) &&
79
+ one_in_two=$(cd ../two && git rev-parse one) &&
80
{
81
echo "$one_in_two "
82
echo "$master_in_two not-for-merge"