Merge branch 'nd/struct-pathspec'

* nd/struct-pathspec:
  pathspec: rename per-item field has_wildcard to use_wildcard
  Improve tree_entry_interesting() handling code
  Convert read_tree{,_recursive} to support struct pathspec
  Reimplement read_tree_recursive() using tree_entry_interesting()
This commit is contained in:
Junio C Hamano
2011-05-06 10:50:06 -07:00
15 changed files with 148 additions and 169 deletions

View File

@ -533,18 +533,18 @@ static int grep_cache(struct grep_opt *opt, const struct pathspec *pathspec, int
static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec,
struct tree_desc *tree, struct strbuf *base, int tn_len)
{
int hit = 0, matched = 0;
int hit = 0, match = 0;
struct name_entry entry;
int old_baselen = base->len;
while (tree_entry(tree, &entry)) {
int te_len = tree_entry_len(entry.path, entry.sha1);
if (matched != 2) {
matched = tree_entry_interesting(&entry, base, tn_len, pathspec);
if (matched == -1)
break; /* no more matches */
if (!matched)
if (match != 2) {
match = tree_entry_interesting(&entry, base, tn_len, pathspec);
if (match < 0)
break;
if (match == 0)
continue;
}