From: Junio C Hamano Date: Mon, 1 Aug 2011 21:43:18 +0000 (-0700) Subject: Merge branch 'jc/maint-1.7.3-checkout-describe' into maint X-Git-Tag: v1.7.6.1~46 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=055f2c5d340508d3542ede8dc1db2aedd0b9f1b5;p=git.git Merge branch 'jc/maint-1.7.3-checkout-describe' into maint * jc/maint-1.7.3-checkout-describe: checkout -b : correctly detect existing branch --- 055f2c5d340508d3542ede8dc1db2aedd0b9f1b5 diff --cc builtin/checkout.c index 28cdc51b8,88708d48b..af1e7b579 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@@ -1069,12 -872,12 +1069,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);