diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/branch.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index 8885d9f8e2..de6df09ed3 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -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); |