Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-11-13 02:26:01 +0300
committerJunio C Hamano <gitster@pobox.com>2018-11-13 06:04:00 +0300
commit5aec9271d343f117eb075a2b7038481f0d9f276f (patch)
tree3bfe174fdc8d5d43da2aca046de47cde727f26c4 /builtin
parent69c92209d2c4d33a25ed79a62a2170c0ff2059e8 (diff)
built-in rebase --skip/--abort: clean up stale .git/<name> files
The scripted version of the rebase used to execute `git reset --hard` when skipping or aborting. When we ported this to C, we did update the worktree and some reflogs, but we failed to imitate `git reset --hard`'s behavior regarding files in .git/ such as MERGE_HEAD. Let's address this oversight. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rebase.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 0ee06aa363..017dce1b50 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -23,6 +23,7 @@
#include "revision.h"
#include "commit-reach.h"
#include "rerere.h"
+#include "branch.h"
static char const * const builtin_rebase_usage[] = {
N_("git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] "
@@ -1002,6 +1003,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (reset_head(NULL, "reset", NULL, 0, NULL, NULL) < 0)
die(_("could not discard worktree changes"));
+ remove_branch_state();
if (read_basic_state(&options))
exit(1);
goto run_rebase;
@@ -1019,6 +1021,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
options.head_name, 0, NULL, NULL) < 0)
die(_("could not move back to %s"),
oid_to_hex(&options.orig_head));
+ remove_branch_state();
ret = finish_rebase(&options);
goto cleanup;
}