summaryrefslogtreecommitdiff
path: root/branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-09-10 17:08:23 +0900
committerJunio C Hamano <gitster@pobox.com>2017-09-10 17:08:24 +0900
commit79553b94f966f3cec6156a68001650ca26a584c4 (patch)
tree37c0d1de2d26a28d67e06993819e8965dd25e942 /branch.c
parent5064d66f5bd86de2f8d5a4b021a616af57f5d8fa (diff)
parent31824d180d4f975e6b130cd9a33a9a0baef3d7ca (diff)
downloadgit-79553b94f966f3cec6156a68001650ca26a584c4.tar.gz
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
Diffstat (limited to 'branch.c')
-rw-r--r--branch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/branch.c b/branch.c
index ce1f8bb58e..703ded69ca 100644
--- a/branch.c
+++ b/branch.c
@@ -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]);