]> git.ipfire.org Git - thirdparty/git.git/blobdiff - worktree.c
Merge branch 'js/t1450-making-it-writable-does-not-need-full-posixperm'
[thirdparty/git.git] / worktree.c
index 2c155b1015082e98634e4a5c80563973e2b29cc4..6f598dcfcdf96fa7b3e4f59bb6a028abef89fdf5 100644 (file)
@@ -404,17 +404,13 @@ int is_worktree_being_bisected(const struct worktree *wt,
  * bisect). New commands that do similar things should update this
  * function as well.
  */
-const struct worktree *find_shared_symref(const char *symref,
+const struct worktree *find_shared_symref(struct worktree **worktrees,
+                                         const char *symref,
                                          const char *target)
 {
        const struct worktree *existing = NULL;
-       static struct worktree **worktrees;
        int i = 0;
 
-       if (worktrees)
-               free_worktrees(worktrees);
-       worktrees = get_worktrees();
-
        for (i = 0; worktrees[i]; i++) {
                struct worktree *wt = worktrees[i];
                const char *symref_target;