worktree.c: store "id" instead of "git_dir"
[gitweb.git] / worktree.h
index b4b3dda79280707d2d65bf790be15c7a1e662b5e..3198c8da2a614ed705a0ee25a7c5a9a7c217eaff 100644 (file)
@@ -3,7 +3,7 @@
 
 struct worktree {
        char *path;
-       char *git_dir;
+       char *id;
        char *head_ref;
        unsigned char head_sha1[20];
        int is_detached;
@@ -22,6 +22,12 @@ struct worktree {
  */
 extern struct worktree **get_worktrees(void);
 
+/*
+ * Return git dir of the worktree. Note that the path may be relative.
+ * If wt is NULL, git dir of current worktree is returned.
+ */
+extern const char *get_worktree_git_dir(const struct worktree *wt);
+
 /*
  * Free up the memory for worktree(s)
  */