summaryrefslogtreecommitdiff
path: root/t/t1512-rev-parse-disambiguation.sh
diff options
context:
space:
mode:
authorElia Pinto <gitter.spiros@gmail.com>2015-12-22 15:05:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-12-27 23:44:49 (GMT)
commitdcfbb2aa891a15fd647ca03f54093c9867ea4f44 (patch)
tree00e4e5f40c7afcbe793c054409f1336499561f4f /t/t1512-rev-parse-disambiguation.sh
parent9fe281b342ec630ff53710d799c3aa6a26f59fa4 (diff)
downloadgit-dcfbb2aa891a15fd647ca03f54093c9867ea4f44.zip
git-dcfbb2aa891a15fd647ca03f54093c9867ea4f44.tar.gz
git-dcfbb2aa891a15fd647ca03f54093c9867ea4f44.tar.bz2
t/t1512-rev-parse-disambiguation.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> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1512-rev-parse-disambiguation.sh')
-rwxr-xr-xt/t1512-rev-parse-disambiguation.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 4a155c8..e221167 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -275,19 +275,19 @@ test_expect_success 'rev-parse --disambiguate' '
test_expect_success 'ambiguous 40-hex ref' '
TREE=$(git mktree </dev/null) &&
- REF=`git rev-parse HEAD` &&
+ REF=$(git rev-parse HEAD) &&
VAL=$(git commit-tree $TREE </dev/null) &&
git update-ref refs/heads/$REF $VAL &&
- test `git rev-parse $REF 2>err` = $REF &&
+ test $(git rev-parse $REF 2>err) = $REF &&
grep "refname.*${REF}.*ambiguous" err
'
test_expect_success 'ambiguous short sha1 ref' '
TREE=$(git mktree </dev/null) &&
- REF=`git rev-parse --short HEAD` &&
+ REF=$(git rev-parse --short HEAD) &&
VAL=$(git commit-tree $TREE </dev/null) &&
git update-ref refs/heads/$REF $VAL &&
- test `git rev-parse $REF 2>err` = $VAL &&
+ test $(git rev-parse $REF 2>err) = $VAL &&
grep "refname.*${REF}.*ambiguous" err
'