Skip to content

Commit f289a6e

Browse files
committed
sequencer (rebase -i): allow rescheduling commands
The interactive rebase has the very special magic that a cherry-pick that exits with a status different from 0 and 1 signifies a failure to even record that a cherry-pick was started. This can happen e.g. when a fast-forward fails because it would overwrite untracked files. In that case, we must reschedule the command that we thought we already had at least started successfully. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent edfb63d commit f289a6e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

sequencer.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,12 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
16831683
1);
16841684
res = do_pick_commit(item->command, item->commit,
16851685
opts, is_final_fixup(todo_list));
1686+
if (IS_REBASE_I() && (res > 1 || res < -1)) {
1687+
/* Reschedule */
1688+
todo_list->current--;
1689+
if (save_todo(todo_list, opts))
1690+
return -1;
1691+
}
16861692
if (item->command == TODO_EDIT) {
16871693
struct commit *commit = item->commit;
16881694
if (!res)

0 commit comments

Comments
 (0)