]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/checkout.c
create_branch: drop unused "head" parameter
[thirdparty/git.git] / builtin / checkout.c
index c3486bdec364fde395cf3523b778ec4dc9c3223a..d561f7491d55c0b49224fa6c47222fb901bf18fe 100644 (file)
@@ -628,7 +628,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
                        }
                }
                else
-                       create_branch(old->name, opts->new_branch, new->name,
+                       create_branch(opts->new_branch, new->name,
                                      opts->new_branch_force ? 1 : 0,
                                      opts->new_branch_log,
                                      opts->new_branch_force ? 1 : 0,
@@ -655,7 +655,8 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
                update_ref(msg.buf, "HEAD", new->commit->object.oid.hash, NULL,
                           REF_NODEREF, UPDATE_REFS_DIE_ON_ERR);
                if (!opts->quiet) {
-                       if (old->path && advice_detached_head)
+                       if (old->path &&
+                           advice_detached_head && !opts->force_detach)
                                detach_advice(new->name);
                        describe_detached_head(_("HEAD is now at"), new->commit);
                }
@@ -703,8 +704,7 @@ static int add_pending_uninteresting_ref(const char *refname,
 static void describe_one_orphan(struct strbuf *sb, struct commit *commit)
 {
        strbuf_addstr(sb, "  ");
-       strbuf_addstr(sb,
-               find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV));
+       strbuf_add_unique_abbrev(sb, commit->object.oid.hash, DEFAULT_ABBREV);
        strbuf_addch(sb, ' ');
        if (!parse_commit(commit))
                pp_commit_easy(CMIT_FMT_ONELINE, commit, sb);