summaryrefslogtreecommitdiff
path: root/builtin/revert.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-20 19:41:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-20 19:41:34 (GMT)
commit39e415cfd1390ed31a61ca0ca175530302c9a58c (patch)
tree3d534af538a48ff09aa5781d91630a15da2508b3 /builtin/revert.c
parent85c54ecc5f26d5273f15ef64e8d756353b222d3b (diff)
parent3e7dd9920823fc2a88f8ec5390bd100d707f9129 (diff)
downloadgit-39e415cfd1390ed31a61ca0ca175530302c9a58c.zip
git-39e415cfd1390ed31a61ca0ca175530302c9a58c.tar.gz
git-39e415cfd1390ed31a61ca0ca175530302c9a58c.tar.bz2
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/revert.c')
-rw-r--r--builtin/revert.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index 76f0a35..9a66720 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')