Merge branch 'ky/branch-m-worktree' into maint
When "git worktree" feature is in use, "git branch -m" renamed a branch that is checked out in another worktree without adjusting the HEAD symbolic ref for the worktree. * ky/branch-m-worktree: set_worktree_head_symref(): fix error message branch -m: update all per-worktree HEADs refs: add a new function set_worktree_head_symref
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user