worktree.c: add find_worktree()
[gitweb.git] / worktree.h
index 13949093cc1610fcafbefb22d1f8b9441fbd4ade..7ad15da0dcbab77d3baa110cd95a6d23c2ee334a 100644 (file)
@@ -29,6 +29,14 @@ extern struct worktree **get_worktrees(void);
  */
 extern const char *get_worktree_git_dir(const struct worktree *wt);
 
+/*
+ * Search a worktree that can be unambiguously identified by
+ * "arg". "prefix" must not be NULL.
+ */
+extern struct worktree *find_worktree(struct worktree **list,
+                                     const char *prefix,
+                                     const char *arg);
+
 /*
  * Free up the memory for worktree(s)
  */