Merge branch 'ky/branch-m-worktree'
[gitweb.git] / builtin / branch.c
index 8885d9f8e2cdbd6b7c3e1ff753147f57ffd37243..de6df09ed30df11ea853b5d815f22d9859ac24cc 100644 (file)
@@ -558,8 +558,7 @@ static void rename_branch(const char *oldname, const char *newname, int force)
        if (recovery)
                warning(_("Renamed a misnamed branch '%s' away"), oldref.buf + 11);
 
-       /* no need to pass logmsg here as HEAD didn't really move */
-       if (!strcmp(oldname, head) && create_symref("HEAD", newref.buf, NULL))
+       if (replace_each_worktree_head_symref(oldref.buf, newref.buf))
                die(_("Branch renamed to %s, but HEAD is not updated!"), newname);
 
        strbuf_addf(&oldsection, "branch.%s", oldref.buf + 11);