summaryrefslogtreecommitdiff
path: root/worktree.h
diff options
context:
space:
mode:
Diffstat (limited to 'worktree.h')
-rw-r--r--worktree.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/worktree.h b/worktree.h
index c28a880e18..df3fc30f73 100644
--- a/worktree.h
+++ b/worktree.h
@@ -1,8 +1,11 @@
#ifndef WORKTREE_H
#define WORKTREE_H
+#include "cache.h"
#include "refs.h"
+struct strbuf;
+
struct worktree {
char *path;
char *id;
@@ -59,6 +62,22 @@ extern int is_main_worktree(const struct worktree *wt);
*/
extern const char *is_worktree_locked(struct worktree *wt);
+#define WT_VALIDATE_WORKTREE_MISSING_OK (1 << 0)
+
+/*
+ * Return zero if the worktree is in good condition. Error message is
+ * returned if "errmsg" is not NULL.
+ */
+extern int validate_worktree(const struct worktree *wt,
+ struct strbuf *errmsg,
+ unsigned flags);
+
+/*
+ * Update worktrees/xxx/gitdir with the new path.
+ */
+extern void update_worktree_location(struct worktree *wt,
+ const char *path_);
+
/*
* Free up the memory for worktree(s)
*/