summaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-29 04:19:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-29 04:19:31 (GMT)
commit1da6d98a9acd2db3902bf432a097771c76f4fd44 (patch)
treecccdbb4533c6998fbba362569906f24c9f4a87cc /builtin/branch.c
parent67c116bb26b4ee31889e5ee15d6a9d3b7e972b7b (diff)
parent587a9ee7da348f5e6696720d770d0e0da597827c (diff)
downloadgit-1da6d98a9acd2db3902bf432a097771c76f4fd44.zip
git-1da6d98a9acd2db3902bf432a097771c76f4fd44.tar.gz
git-1da6d98a9acd2db3902bf432a097771c76f4fd44.tar.bz2
Merge branch 'ci/forbid-unwanted-current-branch-update'
* ci/forbid-unwanted-current-branch-update: Show interpreted branch name in error messages Prevent force-updating of the current branch
Diffstat (limited to 'builtin/branch.c')
-rw-r--r--builtin/branch.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index f7da69c..aa705a0 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -566,11 +566,7 @@ static void rename_branch(const char *oldname, const char *newname, int force)
die(_("Invalid branch name: '%s'"), oldname);
}
- if (strbuf_check_branch_ref(&newref, newname))
- die(_("Invalid branch name: '%s'"), newname);
-
- if (resolve_ref(newref.buf, sha1, 1, NULL) && !force)
- die(_("A branch named '%s' already exists."), newref.buf + 11);
+ validate_new_branchname(newname, &newref, force);
strbuf_addf(&logmsg, "Branch: renamed %s to %s",
oldref.buf, newref.buf);