git-p4: add failing test for shelved CL update involving move/copy
[gitweb.git] / worktree.h
index 55d449b6a9777e5db603dadd6e36fddf1d96b01a..9e3b0b7b6f9bd2aad3de9094febb8ad76aa45caf 100644 (file)
@@ -108,4 +108,28 @@ 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);
+
+/*
+ * Return a refname suitable for access from the current ref store.
+ */
+void strbuf_worktree_ref(const struct worktree *wt,
+                        struct strbuf *sb,
+                        const char *refname);
+
+/*
+ * Return a refname suitable for access from the current ref
+ * store. The result will be destroyed at the next call.
+ */
+const char *worktree_ref(const struct worktree *wt,
+                        const char *refname);
+
 #endif