diff options
author | Patrick Steinhardt <ps@pks.im> | 2015-10-21 11:48:02 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2017-02-13 10:28:15 +0100 |
commit | 45f2b7a43ffe77bac3acbf21a041b56f03842ba8 (patch) | |
tree | 8bc78ba8af8f5f7608c4e8b18bf42282cbfb4152 /include/git2/worktree.h | |
parent | 854b5c70e3f8f4701d005cbd0623f0bef8d00060 (diff) | |
download | libgit2-45f2b7a43ffe77bac3acbf21a041b56f03842ba8.tar.gz |
worktree: implement `git_worktree_list`
Add new module for working trees with the `git_worktree_list`
function. The function lists names for all working trees of a
certain repository.
Diffstat (limited to 'include/git2/worktree.h')
-rw-r--r-- | include/git2/worktree.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/git2/worktree.h b/include/git2/worktree.h new file mode 100644 index 000000000..c09fa32d0 --- /dev/null +++ b/include/git2/worktree.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_worktree_h__ +#define INCLUDE_git_worktree_h__ + +#include "common.h" +#include "types.h" +#include "strarray.h" + +/** + * @file git2/worktrees.h + * @brief Git worktree related functions + * @defgroup git_commit Git worktree related functions + * @ingroup Git + * @{ + */ +GIT_BEGIN_DECL + +/** + * List names of linked working trees + * + * The returned list should be released with `git_strarray_free` + * when no longer needed. + * + * @param out pointer to the array of working tree names + * @param repo the repo to use when listing working trees + * @return 0 or an error code + */ +GIT_EXTERN(int) git_worktree_list(git_strarray *out, git_repository *repo); + +/** @} */ +GIT_END_DECL +#endif |