t/t7602-merge-octopus-many.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 8, 2016 at 12:06 UTC
cf60c8f346aff1a1e45b1c3fd2f8d3ab1483c275
1 file changed
+4
-4
t/t7602-merge-octopus-many.sh
+4
-4
@@ -19,7 +19,7 @@ test_expect_success 'setup' '
19
git add c$i.c &&
20
git commit -m c$i &&
21
git tag c$i &&
22
- i=`expr $i + 1` || return 1
22
+ i=$(expr $i + 1) || return 1
23
done
24
'
25
@@ -30,7 +30,7 @@ test_expect_success 'merge c1 with c2, c3, c4, ... c29' '
30
while test $i -le 30
31
do
32
refs="$refs c$i"
33
- i=`expr $i + 1`
33
+ i=$(expr $i + 1)
34
done &&
35
git merge $refs &&
36
test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
@@ -38,14 +38,14 @@ test_expect_success 'merge c1 with c2, c3, c4, ... c29' '
38
while test $i -le 30
39
do
40
test "$(git rev-parse c$i)" = "$(git rev-parse HEAD^$i)" &&
41
- i=`expr $i + 1` || return 1
41
+ i=$(expr $i + 1) || return 1
42
done &&
43
git diff --exit-code &&
44
i=1 &&
45
while test $i -le 30
46
do
47
test -f c$i.c &&
48
- i=`expr $i + 1` || return 1
48
+ i=$(expr $i + 1) || return 1
49
done
50
'
51