diff options
author | Elia Pinto <gitter.spiros@gmail.com> | 2015-12-22 15:05:50 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-12-27 23:44:49 (GMT) |
commit | dcfbb2aa891a15fd647ca03f54093c9867ea4f44 (patch) | |
tree | 00e4e5f40c7afcbe793c054409f1336499561f4f /t/t1512-rev-parse-disambiguation.sh | |
parent | 9fe281b342ec630ff53710d799c3aa6a26f59fa4 (diff) | |
download | git-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-x | t/t1512-rev-parse-disambiguation.sh | 8 |
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 ' |