remove match_pathspec() in favor of match_pathspec_depth()
[gitweb.git] / builtin / diff.c
index 9fc273d8cd78d53a55047e17d44eb89291741167..bb84ba0e4694a6ef2cda7898ec9c61fa80bf74ae 100644 (file)
@@ -140,7 +140,7 @@ static int builtin_diff_index(struct rev_info *revs,
                usage(builtin_diff_usage);
        if (!cached) {
                setup_work_tree();
-               if (read_cache_preload(revs->diffopt.pathspec.raw) < 0) {
+               if (read_cache_preload(&revs->diffopt.pathspec) < 0) {
                        perror("read_cache_preload");
                        return -1;
                }
@@ -242,7 +242,7 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
                revs->combine_merges = revs->dense_combined_merges = 1;
 
        setup_work_tree();
-       if (read_cache_preload(revs->diffopt.pathspec.raw) < 0) {
+       if (read_cache_preload(&revs->diffopt.pathspec) < 0) {
                perror("read_cache_preload");
                return -1;
        }
@@ -367,6 +367,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
                }
        }
        if (rev.prune_data.nr) {
+               /* builtin_diff_b_f() */
+               GUARD_PATHSPEC(&rev.prune_data, PATHSPEC_FROMTOP);
                if (!path)
                        path = rev.prune_data.items[0].match;
                paths += rev.prune_data.nr;