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>
This commit is contained in:

committed by
Junio C Hamano

parent
15cdfea734
commit
69dfe3b942
@ -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)
|
||||
*/
|
||||
|
Reference in New Issue
Block a user