t1002-read-tree-m-u-2way.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 <gitter.spiros@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elia Pinto committed
Apr 28, 2014 at 05:57 UTC
9b3bc877f0b01826beaa3ef00b5e3b2c49fb09cc
1 file changed
+5
-5
t/t1002-read-tree-m-u-2way.sh
+5
-5
@@ -21,7 +21,7 @@ compare_change () {
21
}
22
23
check_cache_at () {
24
- clean_if_empty=`git diff-files -- "$1"`
24
+ clean_if_empty=$(git diff-files -- "$1")
25
case "$clean_if_empty" in
26
'') echo "$1: clean" ;;
27
?*) echo "$1: dirty" ;;
@@ -41,14 +41,14 @@ test_expect_success \
41
echo bozbar >bozbar &&
42
echo rezrov >rezrov &&
43
git update-index --add nitfol bozbar rezrov &&
44
- treeH=`git write-tree` &&
44
+ treeH=$(git write-tree) &&
45
echo treeH $treeH &&
46
git ls-tree $treeH &&
47
48
echo gnusto >bozbar &&
49
git update-index --add frotz bozbar --force-remove rezrov &&
50
git ls-files --stage >M.out &&
51
- treeM=`git write-tree` &&
51
+ treeM=$(git write-tree) &&
52
echo treeM $treeM &&
53
git ls-tree $treeM &&
54
sum bozbar frotz nitfol >M.sum &&
@@ -318,7 +318,7 @@ test_expect_success \
318
'rm -f .git/index &&
319
echo DF >DF &&
320
git update-index --add DF &&
321
- treeDF=`git write-tree` &&
321
+ treeDF=$(git write-tree) &&
322
echo treeDF $treeDF &&
323
git ls-tree $treeDF &&
324
@@ -326,7 +326,7 @@ test_expect_success \
326
mkdir DF &&
327
echo DF/DF >DF/DF &&
328
git update-index --add --remove DF DF/DF &&
329
- treeDFDF=`git write-tree` &&
329
+ treeDFDF=$(git write-tree) &&
330
echo treeDFDF $treeDFDF &&
331
git ls-tree $treeDFDF &&
332
git ls-files --stage >DFDF.out'