[PATCH 086/144] t7001-mv.sh: use the $( ... ) construct for command substitution
- From
Elia Pinto <gitter.spiros@gmail.com>
- Date
- Mar 25, 2014, 08:25 UTC
- Message-ID
- <1395735989-3396-87-git-send-email-gitter.spiros@gmail.com>
- In-Reply-To
- <1395735989-3396-1-git-send-email-gitter.spiros@gmail.com>
The Git CodingGuidelines prefer the $( ... ) construct for command substitution instead of using the back-quotes, or grave accents (`..`).
The backquoted form is the historical 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. Because of this the POSIX shell adopted the $(…) feature from the Korn shell.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> --- t/t7001-mv.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index e3c8c2c..23564bf 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -156,11 +156,11 @@ test_expect_success "Michael Cassar's test case" ' echo b > partA/outline.txt && echo c > papers/unsorted/_another && git add papers partA && - T1=`git write-tree` && + T1=$(git write-tree) && git mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf && - T=`git write-tree` && + T=$(git write-tree) && git ls-tree -r $T | grep partA/outline.txt || { git ls-tree -r $T (exit 1)
-- 1.7.10.4