diff options
| author | Patrick Steinhardt <ps@pks.im> | 2015-10-21 12:02:31 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2017-02-13 10:28:15 +0100 |
| commit | d3bc09e81687ca132226e93ce69b9a28b8d3c66b (patch) | |
| tree | fd1c69feb7f9cc665ac995ed4f30c45212c8b419 /include/git2/worktree.h | |
| parent | 45f2b7a43ffe77bac3acbf21a041b56f03842ba8 (diff) | |
| download | libgit2-d3bc09e81687ca132226e93ce69b9a28b8d3c66b.tar.gz | |
worktree: introduce `struct git_worktree`
Introduce a new `struct git_worktree`, which holds information
about a possible working tree connected to a repository.
Introduce functions to allow opening working trees for a
repository.
Diffstat (limited to 'include/git2/worktree.h')
| -rw-r--r-- | include/git2/worktree.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/git2/worktree.h b/include/git2/worktree.h index c09fa32d0..8313265d5 100644 --- a/include/git2/worktree.h +++ b/include/git2/worktree.h @@ -32,6 +32,23 @@ GIT_BEGIN_DECL */ GIT_EXTERN(int) git_worktree_list(git_strarray *out, git_repository *repo); +/** + * Lookup a working tree by its name for a given repository + * + * @param out Output pointer to looked up worktree or `NULL` + * @param repo The repository containing worktrees + * @param name Name of the working tree to look up + * @return 0 or an error code + */ +GIT_EXTERN(int) git_worktree_lookup(git_worktree **out, git_repository *repo, const char *name); + +/** + * Free a previously allocated worktree + * + * @param wt worktree handle to close. If NULL nothing occurs. + */ +GIT_EXTERN(void) git_worktree_free(git_worktree *wt); + /** @} */ GIT_END_DECL #endif |
