sha1_file: set whence in storage-specific info fn
[gitweb.git] / worktree.h
index 90e1311fa73fa6bdde5249d68818eacb6dc8edd0..5ea5e503fbe491a76d3c8ce279b7e281a5d07d3e 100644 (file)
@@ -4,7 +4,7 @@
 struct worktree {
        char *path;
        char *id;
-       char *head_ref;
+       char *head_ref;         /* NULL if HEAD is broken or detached */
        char *lock_reason;      /* internal use */
        unsigned char head_sha1[20];
        int is_detached;
@@ -15,6 +15,8 @@ struct worktree {
 
 /* Functions for acting on the information about worktrees. */
 
+#define GWT_SORT_LINKED (1 << 0) /* keeps linked worktrees sorted */
+
 /*
  * Get the worktrees.  The primary worktree will always be the first returned,
  * and linked worktrees will be pointed to by 'next' in each subsequent
@@ -23,7 +25,12 @@ struct worktree {
  * The caller is responsible for freeing the memory from the returned
  * worktree(s).
  */
-extern struct worktree **get_worktrees(void);
+extern struct worktree **get_worktrees(unsigned flags);
+
+/*
+ * Returns 1 if linked worktrees exist, 0 otherwise.
+ */
+extern int submodule_uses_worktrees(const char *path);
 
 /*
  * Return git dir of the worktree. Note that the path may be relative.