From: Junio C Hamano Date: Thu, 30 Jun 2011 00:03:12 +0000 (-0700) Subject: Merge branch 'jc/maint-1.7.3-checkout-describe' X-Git-Tag: v1.7.7-rc0~120 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b985f2aecaa6358b55d545385d0624d76ff83fb8;p=git.git Merge branch 'jc/maint-1.7.3-checkout-describe' * jc/maint-1.7.3-checkout-describe: checkout -b : correctly detect existing branch --- b985f2aecaa6358b55d545385d0624d76ff83fb8 diff --cc builtin/checkout.c index 015730fbd,88708d48b..f152adf9a --- a/builtin/checkout.c +++ b/builtin/checkout.c @@@ -1070,12 -872,12 +1070,12 @@@ int cmd_checkout(int argc, const char * if (opts.new_branch) { struct strbuf buf = STRBUF_INIT; if (strbuf_check_branch_ref(&buf, opts.new_branch)) - die("git checkout: we do not like '%s' as a branch name.", + 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", + die(_("git checkout: branch %s already exists"), opts.new_branch); } strbuf_release(&buf);