author | Junio C Hamano <gitster@pobox.com> | |
Thu, 30 Jun 2011 00:03:12 +0000 (17:03 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 30 Jun 2011 00:03:12 +0000 (17:03 -0700) |
* jc/maint-1.7.3-checkout-describe:
checkout -b <name>: correctly detect existing branch
checkout -b <name>: correctly detect existing branch
1 | 2 | |||
---|---|---|---|---|
builtin/checkout.c | patch | | diff1 | | diff2 | | blob | history |
refs.c | patch | | diff1 | | diff2 | | blob | history |
refs.h | patch | | diff1 | | diff2 | | blob | history |
t/t2018-checkout-branch.sh | patch | | diff1 | | diff2 | | blob | history |
diff --cc builtin/checkout.c
index 015730fbd5c66eb60c3999ffbfaf33f07b841315,88708d48bf5483a537839a2b1439af2880b1fd35..f152adf9ab71287e02e9e85c0b84aae096e5bec7
--- 1/builtin/checkout.c
--- 2/builtin/checkout.c
+++ b/builtin/checkout.c
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);
diff --cc refs.c
Simple merge
diff --cc refs.h
Simple merge
diff --cc t/t2018-checkout-branch.sh
Simple merge