summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-01-02 15:28:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-09 22:57:30 (GMT)
commit9d7bf3cf993ab59e0f9d7150534213f57dd12741 (patch)
tree5894bfc7cbecbfcbf478bcb285ebcb19867bbbed /sequencer.c
parentca6c6b45dd9c36ae3e0b4f1fc9812d1e6a8b59bc (diff)
downloadgit-9d7bf3cf993ab59e0f9d7150534213f57dd12741.zip
git-9d7bf3cf993ab59e0f9d7150534213f57dd12741.tar.gz
git-9d7bf3cf993ab59e0f9d7150534213f57dd12741.tar.bz2
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c
index 04a64cf..dd5b843 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1915,6 +1915,12 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
1);
res = do_pick_commit(item->command, item->commit,
opts, is_final_fixup(todo_list));
+ if (is_rebase_i(opts) && res < 0) {
+ /* Reschedule */
+ todo_list->current--;
+ if (save_todo(todo_list, opts))
+ return -1;
+ }
if (item->command == TODO_EDIT) {
struct commit *commit = item->commit;
if (!res)