X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=tree-diff.c;h=7a51d091b5a6babed91f60b9ff7079308afa4e6f;hb=f0b4fd47074d8cf3f9db9c444c8e1e125e0cc517;hp=6782484489eb91b770d18b997962847d2cb8a6f0;hpb=0de1633783685e9fb1943551217cdda7edbd245b;p=git.git diff --git a/tree-diff.c b/tree-diff.c index 678248448..7a51d091b 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -64,14 +64,14 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2, static void show_tree(struct diff_options *opt, const char *prefix, struct tree_desc *desc, struct strbuf *base) { - int match = 0; + enum interesting match = entry_not_interesting; for (; desc->size; update_tree_entry(desc)) { - if (match != 2) { + if (match != all_entries_interesting) { match = tree_entry_interesting(&desc->entry, base, 0, &opt->pathspec); - if (match < 0) + if (match == all_entries_not_interesting) break; - if (match == 0) + if (match == entry_not_interesting) continue; } show_entry(opt, prefix, desc, base); @@ -114,12 +114,13 @@ static void show_entry(struct diff_options *opt, const char *prefix, } static void skip_uninteresting(struct tree_desc *t, struct strbuf *base, - struct diff_options *opt, int *match) + struct diff_options *opt, + enum interesting *match) { while (t->size) { *match = tree_entry_interesting(&t->entry, base, 0, &opt->pathspec); if (*match) { - if (*match < 0) + if (*match == all_entries_not_interesting) t->size = 0; break; } @@ -132,7 +133,8 @@ int diff_tree(struct tree_desc *t1, struct tree_desc *t2, { struct strbuf base; int baselen = strlen(base_str); - int t1_match = 0, t2_match = 0; + enum interesting t1_match = entry_not_interesting; + enum interesting t2_match = entry_not_interesting; /* Enable recursion indefinitely */ opt->pathspec.recursive = DIFF_OPT_TST(opt, RECURSIVE);