зеркало из https://github.com/microsoft/git.git
git-sh-setup: fix parseopt `eval` string underquoting
The 'automagic parseopt' support corrupted non option parameters that had IFS characters in them. The worst case is when it had a non option parameter like this: $1=" * some string" Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
dfdd7e6686
Коммит
cbea86fd14
|
@ -21,11 +21,12 @@ if test -n "$OPTIONS_SPEC"; then
|
|||
exec "$0" -h
|
||||
}
|
||||
|
||||
parseopt_extra=
|
||||
[ -n "$OPTIONS_KEEPDASHDASH" ] &&
|
||||
parseopt_extra="$parseopt_extra --keep-dashdash"
|
||||
|
||||
eval `echo "$OPTIONS_SPEC" | git rev-parse --parseopt $parseopt_extra -- "$@" || echo exit $?`
|
||||
[ -n "$OPTIONS_KEEPDASHDASH" ] && parseopt_extra="--keep-dashdash"
|
||||
parsed=$(
|
||||
echo "$OPTIONS_SPEC" |
|
||||
git rev-parse --parseopt $parseopt_extra -- "$@"
|
||||
) &&
|
||||
eval "$parsed" || exit
|
||||
else
|
||||
usage() {
|
||||
die "Usage: $0 $USAGE"
|
||||
|
|
Загрузка…
Ссылка в новой задаче