summaryrefslogtreecommitdiff
path: root/worktree.h
diff options
context:
space:
mode:
Diffstat (limited to 'worktree.h')
-rw-r--r--worktree.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/worktree.h b/worktree.h
index df3fc30f73..440bb219dd 100644
--- a/worktree.h
+++ b/worktree.h
@@ -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