From: Elia Pinto Date: Tue, 22 Dec 2015 15:05:50 +0000 (+0100) Subject: t/t1512-rev-parse-disambiguation.sh: use the $( ... ) construct for command substitution X-Git-Tag: v2.8.0-rc0~103^2~77 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=dcfbb2aa891a15fd647ca03f54093c9867ea4f44;p=git-core%2Fgit.git 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 Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh index 4a155c8d0..e221167cf 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 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 err` = $VAL && + test $(git rev-parse $REF 2>err) = $VAL && grep "refname.*${REF}.*ambiguous" err '