summaryrefslogtreecommitdiff
path: root/include/git2/worktree.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2015-10-23 14:11:44 +0200
committerPatrick Steinhardt <ps@pks.im>2017-02-13 11:00:17 +0100
commitdea7488e93bdd9a0291d518af58b1cde6d71aca9 (patch)
tree4a20184011c124693fcc520c98af2608cdb2a01f /include/git2/worktree.h
parent372dc9ff6ada409204b7c3de882e5dad16f30b36 (diff)
downloadlibgit2-dea7488e93bdd9a0291d518af58b1cde6d71aca9.tar.gz
worktree: implement `git_worktree_add`
Implement the `git_worktree_add` function which can be used to create new working trees for a given repository.
Diffstat (limited to 'include/git2/worktree.h')
-rw-r--r--include/git2/worktree.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/git2/worktree.h b/include/git2/worktree.h
index c6ca30bcd..4b045eeb8 100644
--- a/include/git2/worktree.h
+++ b/include/git2/worktree.h
@@ -61,6 +61,21 @@ GIT_EXTERN(void) git_worktree_free(git_worktree *wt);
*/
GIT_EXTERN(int) git_worktree_validate(const git_worktree *wt);
+/**
+ * Add a new working tree
+ *
+ * Add a new working tree for the repository, that is create the
+ * required data structures inside the repository and check out
+ * the current HEAD at `path`
+ *
+ * @param out Output pointer containing new working tree
+ * @param repo Repository to create working tree for
+ * @param name Name of the working tree
+ * @param path Path to create working tree at
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_worktree_add(git_worktree **out, git_repository *repo, const char *name, const char *path);
+
/** @} */
GIT_END_DECL
#endif