t/t5305-include-tag.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
Dec 23, 2015 at 14:45 UTC
0469cb96e354e71d6f07d4cbfe58cf7d868d6b4a
1 file changed
+4
-4
t/t5305-include-tag.sh
+4
-4
@@ -3,20 +3,20 @@
3
test_description='git pack-object --include-tag'
4
. ./test-lib.sh
5
6
-TRASH=`pwd`
6
+TRASH=$(pwd)
7
8
test_expect_success setup '
9
echo c >d &&
10
git update-index --add d &&
11
- tree=`git write-tree` &&
12
- commit=`git commit-tree $tree </dev/null` &&
11
+ tree=$(git write-tree) &&
12
+ commit=$(git commit-tree $tree </dev/null) &&
13
echo "object $commit" >sig &&
14
echo "type commit" >>sig &&
15
echo "tag mytag" >>sig &&
16
echo "tagger $(git var GIT_COMMITTER_IDENT)" >>sig &&
17
echo >>sig &&
18
echo "our test tag" >>sig &&
19
- tag=`git mktag <sig` &&
19
+ tag=$(git mktag <sig) &&
20
rm d sig &&
21
git update-ref refs/tags/mytag $tag && {
22
echo $tree &&