refs: new ref types to make per-worktree refs visible to all worktrees
[gitweb.git] / worktree.h
index df3fc30f73692d296fc875bf1944813fa7e1fb3a..440bb219ddc585979f9f6a4c9d994f0d5057244d 100644 (file)
@@ -108,4 +108,13 @@ extern const char *worktree_git_path(const struct worktree *wt,
                                     const char *fmt, ...)
        __attribute__((format (printf, 2, 3)));
 
+/*
+ * Parse a worktree ref (i.e. with prefix main-worktree/ or
+ * worktrees/) and return the position of the worktree's name and
+ * length (or NULL and zero if it's main worktree), and ref.
+ *
+ * All name, name_length and ref arguments could be NULL.
+ */
+int parse_worktree_ref(const char *worktree_ref, const char **name,
+                      int *name_length, const char **ref);
 #endif