From dcfbb2aa891a15fd647ca03f54093c9867ea4f44 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Tue, 22 Dec 2015 16:05:50 +0100 Subject: 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 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 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 ' -- cgit v0.10.2-6-g49f6