userdiff.c: remove implicit dependency on the_index
[gitweb.git] / tree-diff.c
index fe2e466ac1dcb164b214ce4856ed9d62884ddbd3..57a15f51f0e13e711ad7d92a0fc04ce5d53d3336 100644 (file)
@@ -557,9 +557,7 @@ struct combine_diff_path *diff_tree_paths(
         * free pre-allocated last element, if any
         * (see path_appendnew() for details about why)
         */
-       if (p->next) {
-               FREE_AND_NULL(p->next);
-       }
+       FREE_AND_NULL(p->next);
 
        return p;
 }
@@ -607,7 +605,7 @@ static void try_to_follow_renames(const struct object_id *old_oid,
        choice = q->queue[0];
        q->nr = 0;
 
-       diff_setup(&diff_opts);
+       repo_diff_setup(the_repository, &diff_opts);
        diff_opts.flags.recursive = 1;
        diff_opts.flags.find_copies_harder = 1;
        diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT;