Code

Remove unused variables
[git.git] / tree-diff.c
index 45a3845c0a37ea5e77d0c7a206e449b78448e240..76f83fcc27e50b12ddbc8f72badd8d29f5b4230d 100644 (file)
@@ -17,7 +17,6 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2,
        const unsigned char *sha1, *sha2;
        int cmp, pathlen1, pathlen2;
        int old_baselen = base->len;
-       int retval = 0;
 
        sha1 = tree_entry_extract(t1, &path1, &mode1);
        sha2 = tree_entry_extract(t2, &path2, &mode2);
@@ -53,7 +52,7 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2,
                                    sha1, sha2, base->buf, 0, 0);
                }
                strbuf_addch(base, '/');
-               retval = diff_tree_sha1(sha1, sha2, base->buf, opt);
+               diff_tree_sha1(sha1, sha2, base->buf, opt);
        } else {
                opt->change(opt, mode1, mode2, sha1, sha2, base->buf, 0, 0);
        }
@@ -72,7 +71,7 @@ static void show_tree(struct diff_options *opt, const char *prefix,
                if (all_interesting)
                        show = 1;
                else {
-                       show = tree_entry_interesting(&desc->entry, base,
+                       show = tree_entry_interesting(&desc->entry, base, 0,
                                                      &opt->pathspec);
                        if (show == 2)
                                all_interesting = 1;
@@ -124,7 +123,7 @@ static void skip_uninteresting(struct tree_desc *t, struct strbuf *base,
                               struct diff_options *opt, int *all_interesting)
 {
        while (t->size) {
-               int show = tree_entry_interesting(&t->entry, base, &opt->pathspec);
+               int show = tree_entry_interesting(&t->entry, base, 0, &opt->pathspec);
                if (show == 2)
                        *all_interesting = 1;
                if (!show) {
@@ -146,6 +145,10 @@ int diff_tree(struct tree_desc *t1, struct tree_desc *t2,
        int all_t1_interesting = 0;
        int all_t2_interesting = 0;
 
+       /* Enable recursion indefinitely */
+       opt->pathspec.recursive = DIFF_OPT_TST(opt, RECURSIVE);
+       opt->pathspec.max_depth = -1;
+
        strbuf_init(&base, PATH_MAX);
        strbuf_add(&base, base_str, baselen);