diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-03-29 22:22:03 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-29 22:22:03 +0300 |
commit | f81853674929cc1dfef6c3f97e4ece9072ba0b0a (patch) | |
tree | 58f59302b3d564a8c876703e7463041d4f0991e5 /builtin | |
parent | 5fe35fcc790f6df1839ff984896f9d5e6710d012 (diff) | |
parent | bdff97a3f6e66107abd136815c8fa1eda5c67aca (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.c | 2 |
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); |