Skip to content

Commit 2eeaf1b

Browse files
dschogitster
authored andcommitted
sequencer: remove overzealous assumption in rebase -i mode
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f56fffe commit 2eeaf1b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sequencer.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,10 @@ static int read_populate_todo(struct todo_list *todo_list,
962962
close(fd);
963963

964964
res = parse_insn_buffer(todo_list->buf.buf, todo_list);
965-
if (!res) {
965+
if (res)
966+
return error(_("Unusable instruction sheet: %s"), todo_file);
967+
968+
if (!is_rebase_i(opts)) {
966969
enum todo_command valid =
967970
opts->action == REPLAY_PICK ? TODO_PICK : TODO_REVERT;
968971
int i;
@@ -976,8 +979,6 @@ static int read_populate_todo(struct todo_list *todo_list,
976979
return error(_("Cannot revert during a cherry-pick."));
977980
}
978981

979-
if (res)
980-
return error(_("Unusable instruction sheet: %s"), todo_file);
981982
return 0;
982983
}
983984

0 commit comments

Comments
 (0)