From 2c3a77f53395ddac549c3a893adbdcbb0ab2ce55 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 8 Apr 2016 17:30:25 +0200 Subject: [PATCH] sequencer (rebase -i): record interrupted commits in rewritten, too When continuing after a `pick` command failed, we want that commit to show up in the rewritten-list (and its notes to be rewritten), too. Signed-off-by: Johannes Schindelin --- sequencer.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sequencer.c b/sequencer.c index 2f436cde44..7ae4faa461 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2027,6 +2027,17 @@ int sequencer_continue(struct replay_opts *opts) } todo_list.current++; } + else if (file_exists(rebase_path_stopped_sha())) { + struct strbuf buf = STRBUF_INIT; + struct object_id oid; + + if (read_oneliner(&buf, rebase_path_stopped_sha(), 1)) { + if (!get_sha1_committish(buf.buf, oid.hash)) + record_in_rewritten(&oid, + peek_command(&todo_list, 0)); + } + strbuf_release(&buf); + } res = pick_commits(&todo_list, opts); release_todo_list: