summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-01 21:43:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-01 21:43:18 (GMT)
commit055f2c5d340508d3542ede8dc1db2aedd0b9f1b5 (patch)
tree7d33f7fc50749cb7acd5a3f25d281ffdf760e88b /builtin
parente08afecd7fe04b519b72f136c4a24b151c748f49 (diff)
parentc17b229454ac3f5d20fd0cff3a663b03c13cb38e (diff)
downloadgit-055f2c5d340508d3542ede8dc1db2aedd0b9f1b5.zip
git-055f2c5d340508d3542ede8dc1db2aedd0b9f1b5.tar.gz
git-055f2c5d340508d3542ede8dc1db2aedd0b9f1b5.tar.bz2
Merge branch 'jc/maint-1.7.3-checkout-describe' into maint
* jc/maint-1.7.3-checkout-describe: checkout -b <name>: correctly detect existing branch
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 28cdc51..af1e7b5 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1071,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"),