X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=tree-diff.c;h=28ad6db9ffa854c3ef9185ba85108e95edc44d51;hb=50c94032844bb184cdeff7779be3b6a23e04d312;hp=6782484489eb91b770d18b997962847d2cb8a6f0;hpb=0de1633783685e9fb1943551217cdda7edbd245b;p=git.git diff --git a/tree-diff.c b/tree-diff.c index 678248448..28ad6db9f 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); @@ -207,6 +209,7 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT; diff_opts.single_follow = opt->pathspec.raw[0]; diff_opts.break_opt = opt->break_opt; + diff_opts.rename_score = opt->rename_score; paths[0] = NULL; diff_tree_setup_paths(paths, &diff_opts); if (diff_setup_done(&diff_opts) < 0)