Merge branch 'nd/cherry-pick-quit-fix'

"git cherry-pick --quit" failed to remove CHERRY_PICK_HEAD even
though we won't be in a cherry-pick session after it returns, which
has been corrected.

* nd/cherry-pick-quit-fix:
  cherry-pick: fix --quit not deleting CHERRY_PICK_HEAD
This commit is contained in:
Junio C Hamano
2018-08-20 12:41:34 -07:00
2 changed files with 13 additions and 3 deletions

View File

@@ -7,6 +7,7 @@
#include "rerere.h"
#include "dir.h"
#include "sequencer.h"
#include "branch.h"
/*
* This implements the builtins revert and cherry-pick.
@@ -191,8 +192,12 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
opts->gpg_sign = xstrdup_or_null(opts->gpg_sign);
opts->strategy = xstrdup_or_null(opts->strategy);
if (cmd == 'q')
return sequencer_remove_state(opts);
if (cmd == 'q') {
int ret = sequencer_remove_state(opts);
if (!ret)
remove_branch_state();
return ret;
}
if (cmd == 'c')
return sequencer_continue(opts);
if (cmd == 'a')