diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2011-10-24 17:36:10 +1100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-27 11:38:24 -0700 |
commit | d688cf07b15b664a2164c3d92bcb5e8265400a2b (patch) | |
tree | e00f6633f9938ef2808bd2c25f71938b805f198a /tree-walk.h | |
parent | 02cb67530e62e77d437cd68b4bb4307ab752b6a0 (diff) | |
download | git-d688cf07b15b664a2164c3d92bcb5e8265400a2b.tar.gz |
tree_entry_interesting(): give meaningful names to return values
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 <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-walk.h')
-rw-r--r-- | tree-walk.h | 12 |
1 files changed, 11 insertions, 1 deletions
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 |