author | Junio C Hamano <gitster@pobox.com> | |
Mon, 1 Aug 2011 21:43:18 +0000 (14:43 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 1 Aug 2011 21:43:18 +0000 (14:43 -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 28cdc51b85e7d433dca085c0080f964d19a391b4,88708d48bf5483a537839a2b1439af2880b1fd35..af1e7b579a83aef15e11c0c5dfa29447e485654c
--- 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