Revert d3f4628e (revert: Remove sequencer state when no commits are pending, 2011-06-06), because this is not the right approach. Instead of increasing coupling between the sequencer and 'git commit', a unified '--continue' that invokes 'git commit' on behalf of the end-user is preferred. Signed-off-by: Ramkumar Ramachandra <artagnon@xxxxxxxxx> --- sequencer.c | 12 +----------- t/t3510-cherry-pick-sequence.sh | 24 ------------------------ 2 files changed, 1 insertions(+), 35 deletions(-) diff --git a/sequencer.c b/sequencer.c index 6762ceb..7caa550 100644 --- a/sequencer.c +++ b/sequencer.c @@ -758,18 +758,8 @@ static int pick_commits(struct replay_insn_list *todo_list, for (cur = todo_list; cur; cur = cur->next) { save_todo(cur); res = do_pick_commit(cur->operand, cur->action, 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; - } } /* diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh index 4b12244..b30f13a 100755 --- a/t/t3510-cherry-pick-sequence.sh +++ b/t/t3510-cherry-pick-sequence.sh @@ -85,30 +85,6 @@ test_expect_success '--reset cleans up sequencer state' ' test_path_is_missing .git/sequencer ' -test_expect_success 'cherry-pick cleans up sequencer state when one commit is left' ' - pristine_detach initial && - test_must_fail git cherry-pick base..picked && - test_path_is_missing .git/sequencer && - echo "resolved" >foo && - git add foo && - git commit && - { - git rev-list HEAD | - git diff-tree --root --stdin | - sed "s/$_x40/OBJID/g" - } >actual && - cat >expect <<-\EOF && - OBJID - :100644 100644 OBJID OBJID M foo - OBJID - :100644 100644 OBJID OBJID M unrelated - OBJID - :000000 100644 OBJID OBJID A foo - :000000 100644 OBJID OBJID A unrelated - EOF - test_cmp expect actual -' - test_expect_success 'cherry-pick does not implicitly stomp an existing operation' ' pristine_detach initial && test_must_fail git cherry-pick base..anotherpick && -- 1.7.6.351.gb35ac.dirty -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html