Browse Source

pull: Fix parsing of -X<option>

As -X parameter can contain arbitrary $IFS characters, we need to
properly quote it from the shell while forming the command line.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Junio C Hamano 15 years ago
parent
commit
14e5d40ca4
  1. 21
      git-pull.sh

21
git-pull.sh

@ -68,10 +68,10 @@ do
1,-X) 1,-X)
usage ;; usage ;;
*,-X) *,-X)
xx="-X $2" xx="-X $(git rev-parse --sq-quote "$2")"
shift ;; shift ;;
*,*) *,*)
xx="$1" ;; xx=$(git rev-parse --sq-quote "$1") ;;
esac esac
merge_args="$merge_args$xx " merge_args="$merge_args$xx "
;; ;;
@ -228,8 +228,15 @@ then
fi fi


merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit
test true = "$rebase" && case "$rebase" in
exec git-rebase $diffstat $strategy_args $merge_args --onto $merge_head \ true)
${oldremoteref:-$merge_head} eval="git-rebase $diffstat $strategy_args $merge_args"
exec git-merge $diffstat $no_commit $squash $no_ff $ff_only $log_arg $strategy_args $merge_args \ eval="$eval --onto $merge_head ${oldremoteref:-$merge_head}"
"$merge_name" HEAD $merge_head $verbosity ;;
*)
eval="git-merge $diffstat $no_commit $squash $no_ff $ff_only"
eval="$eval $log_arg $strategy_args $merge_args"
eval="$eval \"$merge_name\" HEAD $merge_head $verbosity"
;;
esac
eval "exec $eval"

Loading…
Cancel
Save