Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
tree-walk: use enum interesting instead of integer
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Fri, 19 Oct 2012 17:14:42 +0000
(
00:14
+0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 19 Oct 2012 20:14:41 +0000
(13:14 -0700)
Commit
d688cf0
(tree_entry_interesting(): give meaningful names to
return values - 2011-10-24) converts most of the tree_entry_interesting
values to the new enum, except "never_interesting". This completes the
conversion.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree-walk.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
d688cf0
)
diff --git
a/tree-walk.c
b/tree-walk.c
index 4a03e9bd2136d1b991355622fa71983d07125460..6dbd8b0ce81af8df6bd569557809c7e06c0b2a7a 100644
(file)
--- a/
tree-walk.c
+++ b/
tree-walk.c
@@
-490,11
+490,11
@@
int get_tree_entry(const unsigned char *tree_sha1, const char *name, unsigned ch
static int match_entry(const struct name_entry *entry, int pathlen,
const char *match, int matchlen,
static int match_entry(const struct name_entry *entry, int pathlen,
const char *match, int matchlen,
-
int
*never_interesting)
+
enum interesting
*never_interesting)
{
int m = -1; /* signals that we haven't called strncmp() */
{
int m = -1; /* signals that we haven't called strncmp() */
- if (*never_interesting) {
+ if (*never_interesting
!= entry_not_interesting
) {
/*
* We have not seen any match that sorts later
* than the current path.
/*
* We have not seen any match that sorts later
* than the current path.
@@
-522,7
+522,7
@@
static int match_entry(const struct name_entry *entry, int pathlen,
* the variable to -1 and that is what will be
* returned, allowing the caller to terminate early.
*/
* the variable to -1 and that is what will be
* returned, allowing the caller to terminate early.
*/
- *never_interesting =
0
;
+ *never_interesting =
entry_not_interesting
;
}
if (pathlen > matchlen)
}
if (pathlen > matchlen)
@@
-584,7
+584,7
@@
enum interesting tree_entry_interesting(const struct name_entry *entry,
{
int i;
int pathlen, baselen = base->len - base_offset;
{
int i;
int pathlen, baselen = base->len - base_offset;
-
int
never_interesting = ps->has_wildcard ?
+
enum interesting
never_interesting = ps->has_wildcard ?
entry_not_interesting : all_entries_not_interesting;
if (!ps->nr) {
entry_not_interesting : all_entries_not_interesting;
if (!ps->nr) {