aboutsummaryrefslogtreecommitdiff
path: root/git-pull.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-17 22:31:38 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-17 22:46:27 -0800
commit14e5d40ca4f4f118fe03cbe5302309170b46096d (patch)
tree427f16aec9ff2f6f6cd4ed77fc4c2748320d9983 /git-pull.sh
parentee2c79552acceaa59a78518c6c084bd515606374 (diff)
downloadgit-14e5d40ca4f4f118fe03cbe5302309170b46096d.tar.gz
git-14e5d40ca4f4f118fe03cbe5302309170b46096d.tar.xz
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>
Diffstat (limited to 'git-pull.sh')
-rwxr-xr-xgit-pull.sh21
1 files changed, 14 insertions, 7 deletions
diff --git a/git-pull.sh b/git-pull.sh
index 6d961b699..fc3536bdf 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -68,10 +68,10 @@ do
1,-X)
usage ;;
*,-X)
- xx="-X $2"
+ xx="-X $(git rev-parse --sq-quote "$2")"
shift ;;
*,*)
- xx="$1" ;;
+ xx=$(git rev-parse --sq-quote "$1") ;;
esac
merge_args="$merge_args$xx "
;;
@@ -228,8 +228,15 @@ then
fi
merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit
-test true = "$rebase" &&
- exec git-rebase $diffstat $strategy_args $merge_args --onto $merge_head \
- ${oldremoteref:-$merge_head}
-exec git-merge $diffstat $no_commit $squash $no_ff $ff_only $log_arg $strategy_args $merge_args \
- "$merge_name" HEAD $merge_head $verbosity
+case "$rebase" in
+true)
+ eval="git-rebase $diffstat $strategy_args $merge_args"
+ eval="$eval --onto $merge_head ${oldremoteref:-$merge_head}"
+ ;;
+*)
+ 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"