if (resolve_ref(ref, sha1, 1, NULL)) {
if (!force)
die("A branch named '%s' already exists.", name);
- else if (!strcmp(head, name))
+ else if (!is_bare_repository() && !strcmp(head, name))
die("Cannot force update the current branch.");
}
int kinds = REF_LOCAL_BRANCH;
int i;
- setup_ident();
git_config(git_branch_config);
for (i = 1; i < argc; i++) {