X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fcheckout.c;h=af1e7b579a83aef15e11c0c5dfa29447e485654c;hb=055f2c5d340508d3542ede8dc1db2aedd0b9f1b5;hp=4761769512a8abcdd5652a93d39be18154e251dd;hpb=e4ae6efb78ca7d2ff16575f841b1781b96a7582c;p=git.git diff --git a/builtin/checkout.c b/builtin/checkout.c index 476176951..af1e7b579 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -306,9 +306,8 @@ static void show_local_changes(struct object *head, struct diff_options *opts) static void describe_detached_head(const char *msg, struct commit *commit) { struct strbuf sb = STRBUF_INIT; - struct pretty_print_context ctx = {0}; parse_commit(commit); - pretty_print_commit(CMIT_FMT_ONELINE, commit, &sb, &ctx); + pp_commit_easy(CMIT_FMT_ONELINE, commit, &sb); fprintf(stderr, "%s %s... %s\n", msg, find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV), sb.buf); strbuf_release(&sb); @@ -623,14 +622,12 @@ static int clear_commit_marks_from_one_ref(const char *refname, static void describe_one_orphan(struct strbuf *sb, struct commit *commit) { - struct pretty_print_context ctx = { 0 }; - parse_commit(commit); strbuf_addstr(sb, " "); strbuf_addstr(sb, find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV)); strbuf_addch(sb, ' '); - pretty_print_commit(CMIT_FMT_ONELINE, commit, sb, &ctx); + pp_commit_easy(CMIT_FMT_ONELINE, commit, sb); strbuf_addch(sb, '\n'); } @@ -1074,7 +1071,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix) if (strbuf_check_branch_ref(&buf, opts.new_branch)) die(_("git checkout: we do not like '%s' as a branch name."), opts.new_branch); - if (!get_sha1(buf.buf, rev)) { + if (ref_exists(buf.buf)) { opts.branch_exists = 1; if (!opts.new_branch_force) die(_("git checkout: branch %s already exists"),