Code

Update draft release notes for 1.5.1
[git.git] / builtin-branch.c
index eaff54ec5f045c479fa08b9d2ba5d16a5e5dee47..d0e720936846355b1ba8937cea9c2a14e5b8856a 100644 (file)
@@ -134,7 +134,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
                 */
 
                if (!force &&
-                   !in_merge_bases(rev, head_rev)) {
+                   !in_merge_bases(rev, &head_rev, 1)) {
                        error("The branch '%s' is not a strict subset of "
                                "your current HEAD.\n"
                                "If you are sure you want to delete it, "
@@ -364,7 +364,7 @@ static void rename_branch(const char *oldname, const char *newname, int force)
        unsigned char sha1[20];
 
        if (!oldname)
-               die("cannot rename the curren branch while not on any.");
+               die("cannot rename the current branch while not on any.");
 
        if (snprintf(oldref, sizeof(oldref), "refs/heads/%s", oldname) > sizeof(oldref))
                die("Old branchname too long");
@@ -387,7 +387,8 @@ static void rename_branch(const char *oldname, const char *newname, int force)
        if (rename_ref(oldref, newref, logmsg))
                die("Branch rename failed");
 
-       if (!strcmp(oldname, head) && create_symref("HEAD", newref))
+       /* no need to pass logmsg here as HEAD didn't really move */
+       if (!strcmp(oldname, head) && create_symref("HEAD", newref, NULL))
                die("Branch renamed to %s, but HEAD is not updated!", newname);
 }