summaryrefslogtreecommitdiff
path: root/worktree.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-04-22 20:01:26 +0700
committerJunio C Hamano <gitster@pobox.com>2016-04-22 14:09:37 -0700
commit69dfe3b9420eb2a7f479a0a4cad663111af2b1f9 (patch)
tree7e179e067824fa9e04d784c6f3b8a50eb9ce2bb5 /worktree.h
parent15cdfea734ffce99d930e8e8016787b57ac47386 (diff)
downloadgit-69dfe3b9420eb2a7f479a0a4cad663111af2b1f9.tar.gz
worktree.c: store "id" instead of "git_dir"
We can reconstruct git_dir from id quite easily. It's a bit hackier to do the reverse. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'worktree.h')
-rw-r--r--worktree.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/worktree.h b/worktree.h
index b4b3dda792..3198c8da2a 100644
--- a/worktree.h
+++ b/worktree.h
@@ -3,7 +3,7 @@
struct worktree {
char *path;
- char *git_dir;
+ char *id;
char *head_ref;
unsigned char head_sha1[20];
int is_detached;
@@ -23,6 +23,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)
*/
extern void free_worktrees(struct worktree **);