From d688cf07b15b664a2164c3d92bcb5e8265400a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 24 Oct 2011 17:36:10 +1100 Subject: tree_entry_interesting(): give meaningful names to return values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is a basic code hygiene to avoid magic constants that are unnamed. Besides, this helps extending the value later on for "interesting, but cannot decide if the entry truely matches yet" (ie. prefix matches) Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- tree-walk.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tree-walk.h') diff --git a/tree-walk.h b/tree-walk.h index 884d01ac33..2bf0db9814 100644 --- a/tree-walk.h +++ b/tree-walk.h @@ -61,6 +61,16 @@ static inline int traverse_path_len(const struct traverse_info *info, const stru return info->pathlen + tree_entry_len(n); } -extern int tree_entry_interesting(const struct name_entry *, struct strbuf *, int, const struct pathspec *ps); +/* in general, positive means "kind of interesting" */ +enum interesting { + all_entries_not_interesting = -1, /* no, and no subsequent entries will be either */ + entry_not_interesting = 0, + entry_interesting = 1, + all_entries_interesting = 2 /* yes, and all subsequent entries will be */ +}; + +extern enum interesting tree_entry_interesting(const struct name_entry *, + struct strbuf *, int, + const struct pathspec *ps); #endif -- cgit v1.2.3