From: Jeff King Date: Fri, 9 Nov 2012 17:51:02 +0000 (-0500) Subject: Merge branch 'nd/tree-walk-enum-cleanup' X-Git-Tag: v1.8.1-rc0~73 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/9d91c0e3d5d1bf9339a31ecbd5f6defdac8540d0?hp=-c Merge branch 'nd/tree-walk-enum-cleanup' * nd/tree-walk-enum-cleanup: tree-walk: use enum interesting instead of integer --- 9d91c0e3d5d1bf9339a31ecbd5f6defdac8540d0 diff --combined tree-walk.c index 492c7cd744,6dbd8b0ce8..3f54c02d76 --- a/tree-walk.c +++ b/tree-walk.c @@@ -490,11 -490,11 +490,11 @@@ int get_tree_entry(const unsigned char 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() */ - if (*never_interesting) { + if (*never_interesting != entry_not_interesting) { /* * We have not seen any match that sorts later * than the current path. @@@ -522,7 -522,7 +522,7 @@@ * 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) @@@ -584,7 -584,7 +584,7 @@@ enum interesting tree_entry_interesting { 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) { @@@ -626,7 -626,7 +626,7 @@@ &never_interesting)) return entry_interesting; - if (ps->items[i].use_wildcard) { + if (item->use_wildcard) { if (!fnmatch(match + baselen, entry->path, 0)) return entry_interesting; @@@ -642,7 -642,7 +642,7 @@@ } match_wildcards: - if (!ps->items[i].use_wildcard) + if (!item->use_wildcard) continue; /* @@@ -661,9 -661,6 +661,9 @@@ /* * Match all directories. We'll try to match files * later on. + * max_depth is ignored but we may consider support it + * in future, see + * http://thread.gmane.org/gmane.comp.version-control.git/163757/focus=163840 */ if (ps->recursive && S_ISDIR(entry->mode)) return entry_interesting;