aboutsummaryrefslogtreecommitdiff
path: root/worktree.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-06-13 19:18:23 +0700
committerJunio C Hamano <gitster@pobox.com>2016-06-13 11:53:14 -0700
commit346ef53058ef25f5a7273ee77c03ebc5f732ad77 (patch)
tree558b0bea3e318e748079dad09dfb0e6d1977cc73 /worktree.h
parent984ad9e56c9d884f7f1aa7d6b2052f3fb082ee5d (diff)
downloadgit-346ef53058ef25f5a7273ee77c03ebc5f732ad77.tar.gz
git-346ef53058ef25f5a7273ee77c03ebc5f732ad77.tar.xz
worktree.c: add is_worktree_locked()
We need this later to avoid double locking a worktree, or unlocking one when it's not even locked. 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, 8 insertions, 0 deletions
diff --git a/worktree.h b/worktree.h
index e1c471523..90e1311fa 100644
--- a/worktree.h
+++ b/worktree.h
@@ -5,10 +5,12 @@ struct worktree {
char *path;
char *id;
char *head_ref;
+ char *lock_reason; /* internal use */
unsigned char head_sha1[20];
int is_detached;
int is_bare;
int is_current;
+ int lock_reason_valid;
};
/* Functions for acting on the information about worktrees. */
@@ -43,6 +45,12 @@ extern struct worktree *find_worktree(struct worktree **list,
extern int is_main_worktree(const struct worktree *wt);
/*
+ * Return the reason string if the given worktree is locked or NULL
+ * otherwise.
+ */
+extern const char *is_worktree_locked(struct worktree *wt);
+
+/*
* Free up the memory for worktree(s)
*/
extern void free_worktrees(struct worktree **);