@@ -281,7 +281,7 @@ pick_one () {
281281
282282 test -d " $rewritten " &&
283283 pick_one_preserving_merges " $@ " && return
284- output eval git cherry-pick $allow_rerere_autoupdate \
284+ output eval git cherry-pick $allow_rerere_autoupdate $allow_empty_message \
285285 ${gpg_sign_opt: +$(git rev-parse --sq-quote " $gpg_sign_opt " )} \
286286 " $strategy_args " $empty_args $ff " $@ "
287287
@@ -406,6 +406,7 @@ pick_one_preserving_merges () {
406406 ;;
407407 * )
408408 output eval git cherry-pick $allow_rerere_autoupdate \
409+ $allow_empty_message \
409410 ${gpg_sign_opt: +$(git rev-parse --sq-quote " $gpg_sign_opt " )} \
410411 " $strategy_args " " $@ " ||
411412 die_with_patch $sha1 " $( eval_gettext " Could not pick \$ sha1" ) "
@@ -559,7 +560,8 @@ do_next () {
559560
560561 mark_action_done
561562 do_pick $sha1 " $rest "
562- git commit --amend --no-post-rewrite ${gpg_sign_opt: +" $gpg_sign_opt " } || {
563+ git commit --amend --no-post-rewrite ${gpg_sign_opt: +" $gpg_sign_opt " } \
564+ $allow_empty_message || {
563565 warn " $( eval_gettext " \
564566Could not amend commit after successfully picking \$ sha1... \$ rest
565567This is most likely due to an empty commit message, or the pre-commit hook
@@ -607,21 +609,21 @@ you are able to reword the commit.")"
607609 # This is an intermediate commit; its message will only be
608610 # used in case of trouble. So use the long version:
609611 do_with_author output git commit --amend --no-verify -F " $squash_msg " \
610- ${gpg_sign_opt: +" $gpg_sign_opt " } ||
612+ ${gpg_sign_opt: +" $gpg_sign_opt " } $allow_empty_message ||
611613 die_failed_squash $sha1 " $rest "
612614 ;;
613615 * )
614616 # This is the final command of this squash/fixup group
615617 if test -f " $fixup_msg "
616618 then
617619 do_with_author git commit --amend --no-verify -F " $fixup_msg " \
618- ${gpg_sign_opt: +" $gpg_sign_opt " } ||
620+ ${gpg_sign_opt: +" $gpg_sign_opt " } $allow_empty_message ||
619621 die_failed_squash $sha1 " $rest "
620622 else
621623 cp " $squash_msg " " $GIT_DIR " /SQUASH_MSG || exit
622624 rm -f " $GIT_DIR " /MERGE_MSG
623625 do_with_author git commit --amend --no-verify -F " $GIT_DIR " /SQUASH_MSG -e \
624- ${gpg_sign_opt: +" $gpg_sign_opt " } ||
626+ ${gpg_sign_opt: +" $gpg_sign_opt " } $allow_empty_message ||
625627 die_failed_squash $sha1 " $rest "
626628 fi
627629 rm -f " $squash_msg " " $fixup_msg "
@@ -754,7 +756,8 @@ case "$action" in
754756continue)
755757 if test ! -d " $rewritten "
756758 then
757- exec git rebase--helper ${force_rebase: +--no-ff} --continue
759+ exec git rebase--helper ${force_rebase: +--no-ff} $allow_empty_message \
760+ --continue
758761 fi
759762 # do we have anything to commit?
760763 if git diff-index --cached --quiet HEAD --
@@ -794,11 +797,11 @@ In both cases, once you're done, continue with:
794797You have uncommitted changes in your working tree. Please commit them
795798first and then run 'git rebase --continue' again." ) "
796799 do_with_author git commit --amend --no-verify -F " $msg " -e \
797- ${gpg_sign_opt: +" $gpg_sign_opt " } ||
800+ ${gpg_sign_opt: +" $gpg_sign_opt " } $allow_empty_message ||
798801 die " $( gettext " Could not commit staged changes." ) "
799802 else
800803 do_with_author git commit --no-verify -F " $msg " -e \
801- ${gpg_sign_opt: +" $gpg_sign_opt " } ||
804+ ${gpg_sign_opt: +" $gpg_sign_opt " } $allow_empty_message ||
802805 die " $( gettext " Could not commit staged changes." ) "
803806 fi
804807 fi
@@ -817,7 +820,8 @@ skip)
817820
818821 if test ! -d " $rewritten "
819822 then
820- exec git rebase--helper ${force_rebase: +--no-ff} --continue
823+ exec git rebase--helper ${force_rebase: +--no-ff} $allow_empty_message \
824+ --continue
821825 fi
822826 do_rest
823827 return 0
@@ -1016,7 +1020,8 @@ checkout_onto
10161020if test -z " $rebase_root " && test ! -d " $rewritten "
10171021then
10181022 require_clean_work_tree " rebase"
1019- exec git rebase--helper ${force_rebase: +--no-ff} --continue
1023+ exec git rebase--helper ${force_rebase: +--no-ff} $allow_empty_message \
1024+ --continue
10201025fi
10211026do_rest
10221027
0 commit comments