Merge branch 'nd/worktree-kill-parse-ref'

"git branch -M a b" while on a branch that is completely unrelated
to either branch a or branch b misbehaved when multiple worktree
was in use.  This has been fixed.

* nd/worktree-kill-parse-ref:
  branch: fix branch renaming not updating HEADs correctly
This commit is contained in:
Junio C Hamano
2017-09-10 17:08:23 +09:00
3 changed files with 17 additions and 3 deletions

View File

@ -30,7 +30,7 @@ static void add_head_info(struct worktree *wt)
target = refs_resolve_ref_unsafe(get_worktree_ref_store(wt),
"HEAD",
RESOLVE_REF_READING,
0,
wt->head_sha1, &flags);
if (!target)
return;