mirror of
https://github.com/git/git.git
synced 2026-08-04 15:11:09 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user