Junio C Hamano  committed 41f5d73

git-checkout: fix "eval" used for merge labelling.

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

  • Participants
  • Parent commits ad0f8c9

Comments (0)

Files changed (1)


 	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