зеркало из https://github.com/microsoft/git.git
request-pull: protect against OPTIONS_KEEPDASHDASH from environment
Like most git commands, request-pull supports a -- delimiter to allow callers to pass arguments that would otherwise be treated as an option afterwards. The internal OPTIONS_KEEPDASHDASH variable is passed empty to git-sh-setup to indicate that request-pull itself does not care about the position of the -- delimiter. But if the user has that variable in her environment, request-pull will see the “--” and fail. Empty it explicitly to guard against this. While at it, make the corresponding fix to git-resurrect, too (all other scripts in git.git already protect themselves). Acked-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
30c56eaa2e
Коммит
50ab6558bf
|
@ -9,6 +9,7 @@ other/Merge <other> into <name> (respectively) commit subjects, which
|
|||
is rather slow but allows you to resurrect other people's topic
|
||||
branches."
|
||||
|
||||
OPTIONS_KEEPDASHDASH=
|
||||
OPTIONS_SPEC="\
|
||||
git resurrect $USAGE
|
||||
--
|
||||
|
|
|
@ -8,6 +8,7 @@ USAGE='<start> <url> [<end>]'
|
|||
LONG_USAGE='Summarizes the changes between two commits to the standard output,
|
||||
and includes the given URL in the generated summary.'
|
||||
SUBDIRECTORY_OK='Yes'
|
||||
OPTIONS_KEEPDASHDASH=
|
||||
OPTIONS_SPEC='git request-pull [options] start url [end]
|
||||
--
|
||||
p show patch text as well
|
||||
|
|
|
@ -211,4 +211,18 @@ test_expect_success 'pull request format' '
|
|||
|
||||
'
|
||||
|
||||
test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '
|
||||
|
||||
(
|
||||
cd local &&
|
||||
OPTIONS_KEEPDASHDASH=Yes &&
|
||||
export OPTIONS_KEEPDASHDASH &&
|
||||
git checkout initial &&
|
||||
git merge --ff-only master &&
|
||||
git push origin master:for-upstream &&
|
||||
git request-pull -- initial "$downstream_url" >../request
|
||||
)
|
||||
|
||||
'
|
||||
|
||||
test_done
|
||||
|
|
Загрузка…
Ссылка в новой задаче