diff --git a/sequencer.c b/sequencer.c index 79252f388e..b65ffcacc7 100644 --- a/sequencer.c +++ b/sequencer.c @@ -1244,8 +1244,7 @@ static int parse_insn_buffer(char *buf, struct todo_list *todo_list) fixup_okay = 1; p = *eol ? eol + 1 : eol; } - if (!todo_list->nr) - return error(_("No commits parsed.")); + return res; } @@ -1269,6 +1268,10 @@ static int read_populate_todo(struct todo_list *todo_list, if (res) return error(_("Unusable instruction sheet: %s"), todo_file); + if (!todo_list->nr && + (!is_rebase_i(opts) || !file_exists(rebase_path_done()))) + return error(_("No commits parsed.")); + if (!is_rebase_i(opts)) { enum todo_command valid = opts->action == REPLAY_PICK ? TODO_PICK : TODO_REVERT;