summaryrefslogtreecommitdiffstats
path: root/include/git2/worktree.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2/worktree.h')
-rw-r--r--include/git2/worktree.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/git2/worktree.h b/include/git2/worktree.h
index 9193eaf..a6e5d17 100644
--- a/include/git2/worktree.h
+++ b/include/git2/worktree.h
@@ -11,6 +11,7 @@
#include "buffer.h"
#include "types.h"
#include "strarray.h"
+#include "checkout.h"
/**
* @file git2/worktrees.h
@@ -85,8 +86,9 @@ GIT_EXTERN(int) git_worktree_validate(const git_worktree *wt);
typedef struct git_worktree_add_options {
unsigned int version;
- int lock; /**< lock newly created worktree */
- git_reference *ref; /**< reference to use for the new worktree HEAD */
+ int lock; /**< lock newly created worktree */
+ int checkout_existing; /**< allow checkout of existing branch matching worktree name */
+ git_reference *ref; /**< reference to use for the new worktree HEAD */
/**
* Options for the checkout.
@@ -95,7 +97,8 @@ typedef struct git_worktree_add_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,GIT_CHECKOUT_OPTIONS_INIT}
+#define GIT_WORKTREE_ADD_OPTIONS_INIT { GIT_WORKTREE_ADD_OPTIONS_VERSION, \
+ 0, 0, NULL, GIT_CHECKOUT_OPTIONS_INIT }
/**
* Initialize git_worktree_add_options structure