summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-08-20 12:41:34 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-08-20 12:41:34 -0700
commit39e415cfd1390ed31a61ca0ca175530302c9a58c (patch)
tree3d534af538a48ff09aa5781d91630a15da2508b3 /builtin
parentMerge branch 'sb/submodule-cleanup' (diff)
parentcherry-pick: fix --quit not deleting CHERRY_PICK_HEAD (diff)
downloadtgif-39e415cfd1390ed31a61ca0ca175530302c9a58c.tar.xz
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
Diffstat (limited to 'builtin')
-rw-r--r--builtin/revert.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index 76f0a35b07..9a66720cfc 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -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')