]> git.ipfire.org Git - thirdparty/git.git/blobdiff - branch.c
worktree.c: kill parse_ref() in favor of refs_resolve_ref_unsafe()
[thirdparty/git.git] / branch.c
index 5c12036b0206fe250f50bea30578785b090f9ee4..0b949b7fb215640cffad654f7c50d8120a31b801 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -355,7 +355,8 @@ int replace_each_worktree_head_symref(const char *oldref, const char *newref,
        for (i = 0; worktrees[i]; i++) {
                if (worktrees[i]->is_detached)
                        continue;
-               if (strcmp(oldref, worktrees[i]->head_ref))
+               if (worktrees[i]->head_ref &&
+                   strcmp(oldref, worktrees[i]->head_ref))
                        continue;
 
                if (set_worktree_head_symref(get_worktree_git_dir(worktrees[i]),