diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-10-23 14:14:16 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-23 14:14:16 +0900 |
commit | 5253ad109af7691d0b0fb3c9670aaaf775412c72 (patch) | |
tree | 00292a2eec45efa23eb82c27471f0730dd78a85d /branch.c | |
parent | 4c2224e83951a685185bb8c1f83b28e22fee0e27 (diff) | |
parent | 31824d180d4f975e6b130cd9a33a9a0baef3d7ca (diff) | |
download | git-5253ad109af7691d0b0fb3c9670aaaf775412c72.tar.gz |
Merge branch 'nd/worktree-kill-parse-ref' into maint
"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
Diffstat (limited to 'branch.c')
-rw-r--r-- | branch.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -357,8 +357,9 @@ int replace_each_worktree_head_symref(const char *oldref, const char *newref, if (worktrees[i]->is_detached) continue; - if (worktrees[i]->head_ref && - strcmp(oldref, worktrees[i]->head_ref)) + if (!worktrees[i]->head_ref) + continue; + if (strcmp(oldref, worktrees[i]->head_ref)) continue; refs = get_worktree_ref_store(worktrees[i]); |