diff options
author | Elia Pinto <gitter.spiros@gmail.com> | 2016-01-07 16:51:48 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-01-08 00:58:37 +0300 |
commit | 994851943e0d8bd8c8c11afed6ea2d12500bda06 (patch) | |
tree | 7b09b0da9ea1cb846176b52f0d38ca36fef35d34 /t/t7003-filter-branch.sh | |
parent | 36b4697fdcc1acbe3cda7d67f6f371ebe9d4f018 (diff) |
t/t7003-filter-branch.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>
Diffstat (limited to 't/t7003-filter-branch.sh')
-rwxr-xr-x | t/t7003-filter-branch.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index 869e0bf073..8868e6e090 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -387,7 +387,7 @@ test_expect_success 'setup submodule' ' git branch original HEAD ' -orig_head=`git show-ref --hash --head HEAD` +orig_head=$(git show-ref --hash --head HEAD) test_expect_success 'rewrite submodule with another content' ' git filter-branch --tree-filter "test -d submod && { @@ -396,7 +396,7 @@ test_expect_success 'rewrite submodule with another content' ' mkdir submod && : > submod/file } || :" HEAD && - test $orig_head != `git show-ref --hash --head HEAD` + test $orig_head != $(git show-ref --hash --head HEAD) ' test_expect_success 'replace submodule revision' ' @@ -405,7 +405,7 @@ test_expect_success 'replace submodule revision' ' "if git ls-files --error-unmatch -- submod > /dev/null 2>&1 then git update-index --cacheinfo 160000 0123456789012345678901234567890123456789 submod fi" HEAD && - test $orig_head != `git show-ref --hash --head HEAD` + test $orig_head != $(git show-ref --hash --head HEAD) ' test_expect_success 'filter commit message without trailing newline' ' |