aboutsummaryrefslogtreecommitdiffstats
path: root/sequencer.c
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2019-05-02 11:22:49 +0100
committerJunio C Hamano <gitster@pobox.com>2019-05-19 10:33:43 +0900
commit6df8df083109b1aa37824fc1ebe2347f887afe34 (patch)
treea42a7136f874e9edebf44fc684a4501a5aaf913a /sequencer.c
parentab15ad1a3b4b04a29415aef8c9afa2f64fc194a2 (diff)
downloadgit-6df8df083109b1aa37824fc1ebe2347f887afe34.tar.gz
rebase -r: always reword merge -c
If a merge can be fast-forwarded then make sure that we still edit the commit message if the user specifies -c. The implementation follows the same pattern that is used for ordinary rewords that are fast-forwarded. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c
index f88a97fb10..9acf458635 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3401,6 +3401,10 @@ static int do_merge(struct repository *r,
rollback_lock_file(&lock);
ret = fast_forward_to(r, &commit->object.oid,
&head_commit->object.oid, 0, opts);
+ if (flags & TODO_EDIT_MERGE_MSG) {
+ run_commit_flags |= AMEND_MSG;
+ goto fast_forward_edit;
+ }
goto leave_merge;
}
@@ -3504,6 +3508,7 @@ static int do_merge(struct repository *r,
* value (a negative one would indicate that the `merge`
* command needs to be rescheduled).
*/
+ fast_forward_edit:
ret = !!run_git_commit(r, git_path_merge_msg(r), opts,
run_commit_flags);