]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/rebase.c
Merge branch 'gc/branch-recurse-submodules-fix'
[thirdparty/git.git] / builtin / rebase.c
index d858add3fe85174beea5f15398d4d2787e2eb998..27fde7bf2815d3f7af22f87d14c098edce5c552d 100644 (file)
@@ -37,7 +37,7 @@ static char const * const builtin_rebase_usage[] = {
                "[--onto <newbase> | --keep-base] [<upstream> [<branch>]]"),
        N_("git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] "
                "--root [<branch>]"),
-       N_("git rebase --continue | --abort | --skip | --edit-todo"),
+       "git rebase --continue | --abort | --skip | --edit-todo",
        NULL
 };
 
@@ -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);