Skip to content

Commit

Permalink
t4116-apply-reverse.sh: use the $( ... ) construct for command substi…
Browse files Browse the repository at this point in the history
…tution

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 <gitter.spiros@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Elia Pinto authored and Junio C Hamano committed Apr 30, 2014
1 parent 274447a commit 991a9c3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions t/t4116-apply-reverse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ test_expect_success setup '

test_expect_success 'apply in forward' '
T0=`git rev-parse "second^{tree}"` &&
T0=$(git rev-parse "second^{tree}") &&
git reset --hard initial &&
git apply --index --binary patch &&
T1=`git write-tree` &&
T1=$(git write-tree) &&
test "$T0" = "$T1"
'

Expand Down Expand Up @@ -62,22 +62,22 @@ test_expect_success 'setup separate repository lacking postimage' '

test_expect_success 'apply in forward without postimage' '
T0=`git rev-parse "second^{tree}"` &&
T0=$(git rev-parse "second^{tree}") &&
(
cd initial &&
git apply --index --binary ../patch &&
T1=`git write-tree` &&
T1=$(git write-tree) &&
test "$T0" = "$T1"
)
'

test_expect_success 'apply in reverse without postimage' '
T0=`git rev-parse "initial^{tree}"` &&
T0=$(git rev-parse "initial^{tree}") &&
(
cd second &&
git apply --index --binary --reverse ../patch &&
T1=`git write-tree` &&
T1=$(git write-tree) &&
test "$T0" = "$T1"
)
'
Expand Down

0 comments on commit 991a9c3

Please sign in to comment.