@@ -80,6 +80,18 @@ amend="$state_dir"/amend
8080rewritten_list=" $state_dir " /rewritten-list
8181rewritten_pending=" $state_dir " /rewritten-pending
8282
83+ strategy_args=
84+ if test -n " $do_merge "
85+ then
86+ strategy_args=${strategy: +--strategy=$strategy }
87+ eval '
88+ for strategy_opt in ' " $strategy_opts " '
89+ do
90+ strategy_args="$strategy_args -X$(git rev-parse --sq-quote "${strategy_opt#--}")"
91+ done
92+ '
93+ fi
94+
8395GIT_CHERRY_PICK_HELP=" $resolvemsg "
8496export GIT_CHERRY_PICK_HELP
8597
@@ -239,7 +251,7 @@ pick_one () {
239251
240252 test -d " $rewritten " &&
241253 pick_one_preserving_merges " $@ " && return
242- output git cherry-pick $empty_args $ff " $@ "
254+ output eval git cherry-pick " $strategy_args " $empty_args $ff " $@ "
243255}
244256
245257pick_one_preserving_merges () {
@@ -340,17 +352,16 @@ pick_one_preserving_merges () {
340352 msg_content=" $( commit_message $sha1 ) "
341353 # No point in merging the first parent, that's HEAD
342354 new_parents=${new_parents# $first_parent }
343- if ! do_with_author output \
344- git merge --no-ff ${strategy: +-s $strategy } -m \
345- " $msg_content " $new_parents
355+ if ! do_with_author output eval \
356+ ' git merge --no-ff $strategy_args -m "$msg_content" $new_parents'
346357 then
347358 printf " %s\n" " $msg_content " > " $GIT_DIR " /MERGE_MSG
348359 die_with_patch $sha1 " Error redoing merge $sha1 "
349360 fi
350361 echo " $sha1 $( git rev-parse HEAD^0) " >> " $rewritten_list "
351362 ;;
352363 * )
353- output git cherry-pick " $@ " ||
364+ output eval git cherry-pick " $strategy_args " " $@ " ||
354365 die_with_patch $sha1 " Could not pick $sha1 "
355366 ;;
356367 esac
0 commit comments