зеркало из https://github.com/microsoft/git.git
t4116-apply-reverse.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 sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
274447aa6b
Коммит
991a9c3af9
|
@ -30,10 +30,10 @@ test_expect_success setup '
|
|||
|
||||
test_expect_success 'apply in forward' '
|
||||
|
||||
T0=`git rev-parse "second^{tree}"` &&
|
||||
T0=$(git rev-parse "second^{tree}") &&
|
||||
git reset --hard initial &&
|
||||
git apply --index --binary patch &&
|
||||
T1=`git write-tree` &&
|
||||
T1=$(git write-tree) &&
|
||||
test "$T0" = "$T1"
|
||||
'
|
||||
|
||||
|
@ -62,22 +62,22 @@ test_expect_success 'setup separate repository lacking postimage' '
|
|||
|
||||
test_expect_success 'apply in forward without postimage' '
|
||||
|
||||
T0=`git rev-parse "second^{tree}"` &&
|
||||
T0=$(git rev-parse "second^{tree}") &&
|
||||
(
|
||||
cd initial &&
|
||||
git apply --index --binary ../patch &&
|
||||
T1=`git write-tree` &&
|
||||
T1=$(git write-tree) &&
|
||||
test "$T0" = "$T1"
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'apply in reverse without postimage' '
|
||||
|
||||
T0=`git rev-parse "initial^{tree}"` &&
|
||||
T0=$(git rev-parse "initial^{tree}") &&
|
||||
(
|
||||
cd second &&
|
||||
git apply --index --binary --reverse ../patch &&
|
||||
T1=`git write-tree` &&
|
||||
T1=$(git write-tree) &&
|
||||
test "$T0" = "$T1"
|
||||
)
|
||||
'
|
||||
|
|
Загрузка…
Ссылка в новой задаче