diff options
Diffstat (limited to 'include/git2/worktree.h')
-rw-r--r-- | include/git2/worktree.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/git2/worktree.h b/include/git2/worktree.h index 23084d8cd..bb024dc94 100644 --- a/include/git2/worktree.h +++ b/include/git2/worktree.h @@ -52,6 +52,7 @@ GIT_EXTERN(int) git_worktree_lookup(git_worktree **out, git_repository *repo, co * * @param out Out-pointer for the newly allocated worktree * @param repo Repository to look up worktree for + * @return 0 or an error code */ GIT_EXTERN(int) git_worktree_open_from_repository(git_worktree **out, git_repository *repo); @@ -86,10 +87,15 @@ typedef struct git_worktree_add_options { int lock; /**< lock newly created worktree */ git_reference *ref; /**< reference to use for the new worktree HEAD */ + + /** + * Options for the checkout. + */ + git_checkout_options checkout_options; } git_worktree_add_options; #define GIT_WORKTREE_ADD_OPTIONS_VERSION 1 -#define GIT_WORKTREE_ADD_OPTIONS_INIT {GIT_WORKTREE_ADD_OPTIONS_VERSION,0,NULL} +#define GIT_WORKTREE_ADD_OPTIONS_INIT {GIT_WORKTREE_ADD_OPTIONS_VERSION,0,NULL,GIT_CHECKOUT_OPTIONS_INIT} /** * Initialize git_worktree_add_options structure @@ -185,7 +191,7 @@ typedef enum { /* Prune working tree even if it is locked */ GIT_WORKTREE_PRUNE_LOCKED = 1u << 1, /* Prune checked out working tree */ - GIT_WORKTREE_PRUNE_WORKING_TREE = 1u << 2, + GIT_WORKTREE_PRUNE_WORKING_TREE = 1u << 2 } git_worktree_prune_t; /** @@ -232,6 +238,10 @@ GIT_EXTERN(int) git_worktree_prune_options_init( * If the worktree is not valid and not locked or if the above * flags have been passed in, this function will return a * positive value. + * + * @param wt Worktree to check. + * @param opts The prunable options. + * @return 1 if the worktree is prunable, 0 otherwise, or an error code. */ GIT_EXTERN(int) git_worktree_is_prunable(git_worktree *wt, git_worktree_prune_options *opts); |