sequencer (rebase -i): record interrupted commits in rewritten, too
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 2 Jan 2017 15:28:20 +0000 (16:28 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Jan 2017 22:57:30 +0000 (14:57 -0800)
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 <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
index 50380a15b83d7df54cdc489bfff50e33dab7afe7..d7273fd1b3d850906bba758437da67314c0eb707 100644 (file)
@@ -2060,6 +2060,14 @@ int sequencer_continue(struct replay_opts *opts)
                        goto release_todo_list;
                }
                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) &&
+                   !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);