1
0
mirror of https://github.com/git/git synced 2024-07-02 15:48:44 +00:00

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
parent dfdd7e6686
commit cbea86fd14

View File

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