From 218b65fbf9428517e739b8bc26680c29910cf1cd Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sat, 10 Dec 2011 07:02:12 -0600 Subject: revert: do not remove state until sequence is finished As v1.7.8-rc0~141^2~4 (2011-08-04) explains, git cherry-pick removes the sequencer state just before applying the final patch. In the single-pick case, that was a good thing, since --abort and --continue work fine without access to such state and removing it provides a signal that git should not complain about the need to clobber it ("a cherry-pick or revert is already in progress") in sequences like the following: git cherry-pick foo git read-tree -m -u HEAD; # forget that; let's try a different one git cherry-pick bar After the recent patch "allow single-pick in the middle of cherry-pick sequence" we don't need that hack any more. In the new regime, a traditional "git cherry-pick " command never looks at .git/sequencer, so we do not need to cripple "git cherry-pick .." for it any more. So now you can run "git cherry-pick --abort" near the end of a multi-pick sequence and it will abort the entire sequence, instead of misbehaving and aborting just the final commit. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- builtin/revert.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'builtin/revert.c') diff --git a/builtin/revert.c b/builtin/revert.c index 5785ff9941..5dcfa6ba69 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -1018,18 +1018,8 @@ static int pick_commits(struct commit_list *todo_list, struct replay_opts *opts) for (cur = todo_list; cur; cur = cur->next) { save_todo(cur, opts); res = do_pick_commit(cur->item, opts); - if (res) { - if (!cur->next) - /* - * An error was encountered while - * picking the last commit; the - * sequencer state is useless now -- - * the user simply needs to resolve - * the conflict and commit - */ - remove_sequencer_state(0); + if (res) return res; - } } /* -- cgit v1.2.1