Thread (30 messages) flat view 30 messages, 3 authors, 2016-06-16
STALE3748d

Revision v1 of 2 in this series.

Revisions (2)
  1. v2 [diff vs current]
  2. v1 current

[PATCH 15/25] worktree.c: add is_main_worktree()

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2016-06-16 02:18:46
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 worktree.c | 5 +++++
 worktree.h | 5 +++++
 2 files changed, 10 insertions(+)
diff --git a/worktree.c b/worktree.c
index e444ad1..e878f49 100644
--- a/worktree.c
+++ b/worktree.c
@@ -214,6 +214,11 @@ struct worktree *find_worktree_by_path(struct worktree **list,
 	return wt;
 }
 
+int is_main_worktree(const struct worktree *wt)
+{
+	return wt && !wt->id;
+}
+
 char *find_shared_symref(const char *symref, const char *target)
 {
 	char *existing = NULL;
diff --git a/worktree.h b/worktree.h
index c163b6b..c7a4d20 100644
--- a/worktree.h
+++ b/worktree.h
@@ -34,6 +34,11 @@ extern struct worktree *find_worktree_by_path(struct worktree **list,
 					      const char *path_);
 
 /*
+ * Return true if the given worktree is the main one.
+ */
+extern int is_main_worktree(const struct worktree *wt);
+
+/*
  * Free up the memory for worktree
  */
 extern void clear_worktree(struct worktree *);
-- 
2.8.0.rc0.210.gd302cd2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help