sh-setup: don't let eval output to be shell-expanded.
authorPierre Habouzit <madcoder@debian.org>
Thu, 8 Nov 2007 09:32:11 +0000 (10:32 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Nov 2007 09:49:01 +0000 (01:49 -0800)
The previous patch missed the same construct in git-clone.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
git-clone.sh
git-sh-setup.sh

index f216f03a77d548f04aba4b64953b66368ce2ef9b..24ad179bbda69ecf68e49896c3c018425b645461 100755 (executable)
@@ -36,7 +36,7 @@ usage() {
        exec "$0" -h
 }
 
-eval `echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?`
+eval "$(echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)"
 
 get_repo_base() {
        (
index f1c4839a9fe2883f1106d9f9ee209fe4b53b3720..5aa62dda15d1c24d0b01845ded4c8bc15e98bf8a 100755 (executable)
@@ -21,12 +21,15 @@ if test -n "$OPTIONS_SPEC"; then
                exec "$0" -h
        }
 
-       [ -n "$OPTIONS_KEEPDASHDASH" ] && parseopt_extra="--keep-dashdash"
-       parsed=$(
+       parseopt_extra=
+       [ -n "$OPTIONS_KEEPDASHDASH" ] &&
+               parseopt_extra="--keep-dashdash"
+
+       eval "$(
                echo "$OPTIONS_SPEC" |
-               git rev-parse --parseopt $parseopt_extra -- "$@"
-       ) &&
-       eval "$parsed" || exit
+                       git rev-parse --parseopt $parseopt_extra -- "$@" ||
+               echo exit $?
+       )"
 else
        usage() {
                die "Usage: $0 $USAGE"