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:
authorJunio C Hamano <gitster@pobox.com>2022-03-29 22:22:03 +0300
committerJunio C Hamano <gitster@pobox.com>2022-03-29 22:22:03 +0300
commitf81853674929cc1dfef6c3f97e4ece9072ba0b0a (patch)
tree58f59302b3d564a8c876703e7463041d4f0991e5 /builtin
parent5fe35fcc790f6df1839ff984896f9d5e6710d012 (diff)
parentbdff97a3f6e66107abd136815c8fa1eda5c67aca (diff)
Merge branch 'jc/rebase-detach-fix'
"git rebase $base $non_branch_commit", when $base is an ancestor or the $non_branch_commit, modified the current branch, which has been corrected. * jc/rebase-detach-fix: rebase: set REF_HEAD_DETACH in checkout_up_to_date() rebase: use test_commit helper in setup
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rebase.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index b29ad2b65e..27fde7bf28 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -829,6 +829,8 @@ static int checkout_up_to_date(struct rebase_options *options)
ropts.oid = &options->orig_head;
ropts.branch = options->head_name;
ropts.flags = RESET_HEAD_RUN_POST_CHECKOUT_HOOK;
+ if (!ropts.branch)
+ ropts.flags |= RESET_HEAD_DETACH;
ropts.head_msg = buf.buf;
if (reset_head(the_repository, &ropts) < 0)
ret = error(_("could not switch to %s"), options->switch_to);