t/t6001-rev-list-graft.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 7, 2016 at 14:51 UTC
11da571a2fd902b1f4e002d185feada1c4b0dd1e
1 file changed
+6
-6
t/t6001-rev-list-graft.sh
+6
-6
@@ -10,15 +10,15 @@ test_expect_success setup '
10
echo >subdir/fileB fileB &&
11
git add fileA subdir/fileB &&
12
git commit -a -m "Initial in one history." &&
13
- A0=`git rev-parse --verify HEAD` &&
13
+ A0=$(git rev-parse --verify HEAD) &&
14
15
echo >fileA fileA modified &&
16
git commit -a -m "Second in one history." &&
17
- A1=`git rev-parse --verify HEAD` &&
17
+ A1=$(git rev-parse --verify HEAD) &&
18
19
echo >subdir/fileB fileB modified &&
20
git commit -a -m "Third in one history." &&
21
- A2=`git rev-parse --verify HEAD` &&
21
+ A2=$(git rev-parse --verify HEAD) &&
22
23
rm -f .git/refs/heads/master .git/index &&
24
@@ -26,15 +26,15 @@ test_expect_success setup '
26
echo >subdir/fileB fileB again &&
27
git add fileA subdir/fileB &&
28
git commit -a -m "Initial in alternate history." &&
29
- B0=`git rev-parse --verify HEAD` &&
29
+ B0=$(git rev-parse --verify HEAD) &&
30
31
echo >fileA fileA modified in alternate history &&
32
git commit -a -m "Second in alternate history." &&
33
- B1=`git rev-parse --verify HEAD` &&
33
+ B1=$(git rev-parse --verify HEAD) &&
34
35
echo >subdir/fileB fileB modified in alternate history &&
36
git commit -a -m "Third in alternate history." &&
37
- B2=`git rev-parse --verify HEAD` &&
37
+ B2=$(git rev-parse --verify HEAD) &&
38
: done
39
'
40