summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-04-25 12:29:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-26 03:28:43 (GMT)
commit537e7d61359233e95d2ca6ef6b9059afca8daa81 (patch)
tree79414a94828c3d321ddd2bd6b2d19ef7d0e242e1 /sequencer.c
parenta9be29c9817067128a2818a609450db6e6722ffd (diff)
downloadgit-537e7d61359233e95d2ca6ef6b9059afca8daa81.zip
git-537e7d61359233e95d2ca6ef6b9059afca8daa81.tar.gz
git-537e7d61359233e95d2ca6ef6b9059afca8daa81.tar.bz2
sequencer: handle post-rewrite for merge commands
In the previous patches, we implemented the basic functionality of the `git rebase -i --rebase-merges` command, in particular the `merge` command to create merge commits in the sequencer. The interactive rebase is a lot more these days, though, than a simple cherry-pick in a loop. For example, it calls the post-rewrite hook (if any) after rebasing with a mapping of the old->new commits. This patch implements the post-rewrite handling for the `merge` command we just introduced. The other commands that were added recently (`label` and `reset`) do not create new commits, therefore post-rewrite hooks do not need to handle them. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c
index e929712..558efc1 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3074,7 +3074,10 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
item->arg, item->arg_len,
item->flags, opts)) < 0)
reschedule = 1;
- else if (res > 0)
+ else if (item->commit)
+ record_in_rewritten(&item->commit->object.oid,
+ peek_command(todo_list, 1));
+ if (res > 0)
/* failed with merge conflicts */
return error_with_patch(item->commit,
item->arg,