worktree.c: add validate_worktree()
[gitweb.git] / worktree.h
index c28a880e1839ef26604d80de78eb9c663a6be381..cb577de8cd431b527be839e5de3c92c2d9963e37 100644 (file)
@@ -3,6 +3,8 @@
 
 #include "refs.h"
 
+struct strbuf;
+
 struct worktree {
        char *path;
        char *id;
@@ -59,6 +61,13 @@ extern int is_main_worktree(const struct worktree *wt);
  */
 extern const char *is_worktree_locked(struct worktree *wt);
 
+/*
+ * 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);
+
 /*
  * Free up the memory for worktree(s)
  */