Skip to content

Commit 991a9c3

Browse files
devzero2000gitster
authored andcommitted
t4116-apply-reverse.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 sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. Signed-off-by: Elia Pinto <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 274447a commit 991a9c3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

t/t4116-apply-reverse.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ test_expect_success setup '
3030

3131
test_expect_success 'apply in forward' '
3232
33-
T0=`git rev-parse "second^{tree}"` &&
33+
T0=$(git rev-parse "second^{tree}") &&
3434
git reset --hard initial &&
3535
git apply --index --binary patch &&
36-
T1=`git write-tree` &&
36+
T1=$(git write-tree) &&
3737
test "$T0" = "$T1"
3838
'
3939

@@ -62,22 +62,22 @@ test_expect_success 'setup separate repository lacking postimage' '
6262

6363
test_expect_success 'apply in forward without postimage' '
6464
65-
T0=`git rev-parse "second^{tree}"` &&
65+
T0=$(git rev-parse "second^{tree}") &&
6666
(
6767
cd initial &&
6868
git apply --index --binary ../patch &&
69-
T1=`git write-tree` &&
69+
T1=$(git write-tree) &&
7070
test "$T0" = "$T1"
7171
)
7272
'
7373

7474
test_expect_success 'apply in reverse without postimage' '
7575
76-
T0=`git rev-parse "initial^{tree}"` &&
76+
T0=$(git rev-parse "initial^{tree}") &&
7777
(
7878
cd second &&
7979
git apply --index --binary --reverse ../patch &&
80-
T1=`git write-tree` &&
80+
T1=$(git write-tree) &&
8181
test "$T0" = "$T1"
8282
)
8383
'

0 commit comments

Comments
 (0)