From: Johannes Schindelin Date: Mon, 10 Oct 2016 17:26:23 GMT Subject: [PATCH v3 21/25] sequencer: remove overzealous assumption in rebase -i mode Message-ID: <15032a93b02d8a0f5a0c48d79b933f4e1a6c9ee1.1476120229.git.johannes.schindelin@gmx.de> In-Reply-To: The sequencer was introduced to make the cherry-pick and revert functionality available as library function, with the original idea being to extend the sequencer to also implement the rebase -i functionality. The test to ensure that all of the commands in the script are identical to the overall operation does not mesh well with that. Therefore let's disable the test in rebase -i mode. While at it, error out early if the "instruction sheet" (i.e. the todo script) could not be parsed. Signed-off-by: Johannes Schindelin --- sequencer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sequencer.c b/sequencer.c index 5cca8d8..ffce095 100644 --- a/sequencer.c +++ b/sequencer.c @@ -971,7 +971,10 @@ static int read_populate_todo(struct todo_list *todo_list, close(fd); res = parse_insn_buffer(todo_list->buf.buf, todo_list); - if (!res) { + if (res) + return error(_("Unusable instruction sheet: %s"), todo_file); + + if (!is_rebase_i(opts)) { enum todo_command valid = opts->action == REPLAY_PICK ? TODO_PICK : TODO_REVERT; int i; @@ -985,8 +988,6 @@ static int read_populate_todo(struct todo_list *todo_list, return error(_("Cannot revert during a cherry-pick.")); } - if (res) - return error(_("Unusable instruction sheet: %s"), todo_file); return 0; } -- 2.10.0.windows.1.325.ge6089c1