connect: split git:// setup into a separate function
[gitweb.git] / branch.c
index ce1f8bb58ebd4709e2b13e85232d7138d5cde0d6..703ded69ca2697f34bc1e225ccecebf33e5ad0b1 100644 (file)
--- 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]);