diff options
| author | Junio C Hamano <gitster@pobox.com> | 2011-12-13 22:02:51 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2011-12-13 22:02:51 -0800 |
| commit | df6246ed78d040f06f095dd62d8db07a0aa19a96 (patch) | |
| tree | cf9da0c48aa9450471d5c09a659cc99a1d3e1159 /list-objects.c | |
| parent | Merge branch 'maint-1.7.7' into maint (diff) | |
| parent | unpack_object_header_buffer(): clear the size field upon error (diff) | |
| download | git-df6246ed78d040f06f095dd62d8db07a0aa19a96.tar.gz git-df6246ed78d040f06f095dd62d8db07a0aa19a96.zip | |
Merge branch 'nd/misc-cleanups' into maint
* nd/misc-cleanups:
unpack_object_header_buffer(): clear the size field upon error
tree_entry_interesting: make use of local pointer "item"
tree_entry_interesting(): give meaningful names to return values
read_directory_recursive: reduce one indentation level
get_tree_entry(): do not call find_tree_entry() on an empty tree
tree-walk.c: do not leak internal structure in tree_entry_len()
Diffstat (limited to 'list-objects.c')
| -rw-r--r-- | list-objects.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/list-objects.c b/list-objects.c index 39d80c0175..3dd4a96019 100644 --- a/list-objects.c +++ b/list-objects.c @@ -71,7 +71,8 @@ static void process_tree(struct rev_info *revs, struct tree_desc desc; struct name_entry entry; struct name_path me; - int match = revs->diffopt.pathspec.nr == 0 ? 2 : 0; + enum interesting match = revs->diffopt.pathspec.nr == 0 ? + all_entries_interesting: entry_not_interesting; int baselen = base->len; if (!revs->tree_objects) @@ -97,12 +98,12 @@ static void process_tree(struct rev_info *revs, init_tree_desc(&desc, tree->buffer, tree->size); while (tree_entry(&desc, &entry)) { - if (match != 2) { + if (match != all_entries_interesting) { match = tree_entry_interesting(&entry, base, 0, &revs->diffopt.pathspec); - if (match < 0) + if (match == all_entries_not_interesting) break; - if (match == 0) + if (match == entry_not_interesting) continue; } |
