]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sequencer.c
sequencer: remove overzealous assumption in rebase -i mode
[thirdparty/git.git] / sequencer.c
index 000ce3e5418d51e19cdf381639b896a80902fc56..bd11db427378e75d03751f5c72b14ece5ef3faff 100644 (file)
@@ -962,7 +962,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;
@@ -976,8 +979,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;
 }