Code

git-checkout: fix "eval" used for merge labelling.
authorJunio C Hamano <junkio@cox.net>
Wed, 14 Mar 2007 16:48:13 +0000 (09:48 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 14 Mar 2007 16:48:13 +0000 (09:48 -0700)
The symbolic notation of the fork point can contain whitespaces (e.g.
"git checkout -m 'HEAD@{9 hours ago}'").  Quote strings properly
when using eval to prepare GITHEAD_$new

Signed-off-by: Junio C Hamano <junkio@cox.net>
git-checkout.sh

index 14835a4aa982af88d758ea014afacf7b2fb1bb1e..83b2639d6f04cad825e539ab73877d3d4cb2db05 100755 (executable)
@@ -196,7 +196,7 @@ else
        work=`git write-tree` &&
        git read-tree --reset -u $new || exit
 
-       eval GITHEAD_$new=${new_name:-${branch:-$new}} &&
+       eval GITHEAD_$new='${new_name:-${branch:-$new}}' &&
        eval GITHEAD_$work=local &&
        export GITHEAD_$new GITHEAD_$work &&
        git merge-recursive $old -- $new $work