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:
Junio C Hamano 2007-11-07 23:04:38 -08:00
Родитель dfdd7e6686
Коммит cbea86fd14
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -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"