sequencer (rebase -i): leave a patch upon error

When doing an interactive rebase, we want to leave a 'patch' file for further inspection by the user (even if we never tried to actually apply that patch, since we're cherry-picking instead). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Jan 2, 2017 at 16:27 UTC 4a5146f9d2f739803b8fde643e02c2a9474fb0e8
1 file changed +3 -1
sequencer.c
+3 -1
@@ -1769,7 +1769,9 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
1769 intend_to_amend();
1770 return error_failed_squash(item->commit, opts,
1771 item->arg_len, item->arg);
1772 - }
1772 + } else if (res && is_rebase_i(opts))
1773 + return res | error_with_patch(item->commit,
1774 + item->arg, item->arg_len, opts, res, 0);
1775 } else if (item->command == TODO_EXEC) {
1776 char *end_of_arg = (char *)(item->arg + item->arg_len);
1777 int saved = *end_of_arg;