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 7b45b6bd6..b17383131 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -552,8 +552,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); |