diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/errors.h | 1 | ||||
| -rw-r--r-- | include/git2/worktree.h | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h index e959ffd8a..1d271366f 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -100,6 +100,7 @@ typedef enum { GITERR_REBASE, GITERR_FILESYSTEM, GITERR_PATCH, + GITERR_WORKTREE } git_error_t; /** diff --git a/include/git2/worktree.h b/include/git2/worktree.h index 8313265d5..c6ca30bcd 100644 --- a/include/git2/worktree.h +++ b/include/git2/worktree.h @@ -49,6 +49,18 @@ GIT_EXTERN(int) git_worktree_lookup(git_worktree **out, git_repository *repo, co */ GIT_EXTERN(void) git_worktree_free(git_worktree *wt); +/** + * Check if worktree is valid + * + * A valid worktree requires both the git data structures inside + * the linked parent repository and the linked working copy to be + * present. + * + * @param wt Worktree to check + * @return 0 when worktree is valid, error-code otherwise + */ +GIT_EXTERN(int) git_worktree_validate(const git_worktree *wt); + /** @} */ GIT_END_DECL #endif |
