@@ -80,6 +80,18 @@ amend="$state_dir"/amend
80
80
rewritten_list=" $state_dir " /rewritten-list
81
81
rewritten_pending=" $state_dir " /rewritten-pending
82
82
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
+
83
95
GIT_CHERRY_PICK_HELP=" $resolvemsg "
84
96
export GIT_CHERRY_PICK_HELP
85
97
@@ -239,7 +251,7 @@ pick_one () {
239
251
240
252
test -d " $rewritten " &&
241
253
pick_one_preserving_merges " $@ " && return
242
- output git cherry-pick $empty_args $ff " $@ "
254
+ output eval git cherry-pick " $strategy_args " $empty_args $ff " $@ "
243
255
}
244
256
245
257
pick_one_preserving_merges () {
@@ -340,17 +352,16 @@ pick_one_preserving_merges () {
340
352
msg_content=" $( commit_message $sha1 ) "
341
353
# No point in merging the first parent, that's HEAD
342
354
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'
346
357
then
347
358
printf " %s\n" " $msg_content " > " $GIT_DIR " /MERGE_MSG
348
359
die_with_patch $sha1 " Error redoing merge $sha1 "
349
360
fi
350
361
echo " $sha1 $( git rev-parse HEAD^0) " >> " $rewritten_list "
351
362
;;
352
363
* )
353
- output git cherry-pick " $@ " ||
364
+ output eval git cherry-pick " $strategy_args " " $@ " ||
354
365
die_with_patch $sha1 " Could not pick $sha1 "
355
366
;;
356
367
esac
0 commit comments