]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diff-lib.c
t0021: avoid grepping for a Perl-specific string at filter output
[thirdparty/git.git] / diff-lib.c
index ca085a03efc280deecd7cefce7ce00f5492a0d4c..7eb66a417aa08daa6f22753eba5c52f32361dfc8 100644 (file)
@@ -641,7 +641,7 @@ int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt)
 
        if (diff_cache(&revs, tree_oid, NULL, 1))
                exit(128);
-       clear_pathspec(&revs.prune_data);
+       release_revisions(&revs);
        return 0;
 }
 
@@ -651,6 +651,7 @@ int index_differs_from(struct repository *r,
 {
        struct rev_info rev;
        struct setup_revision_opt opt;
+       unsigned has_changes;
 
        repo_init_revisions(r, &rev, NULL);
        memset(&opt, 0, sizeof(opt));
@@ -662,8 +663,9 @@ int index_differs_from(struct repository *r,
                diff_flags_or(&rev.diffopt.flags, flags);
        rev.diffopt.ita_invisible_in_index = ita_invisible_in_index;
        run_diff_index(&rev, 1);
-       object_array_clear(&rev.pending);
-       return (rev.diffopt.flags.has_changes != 0);
+       has_changes = rev.diffopt.flags.has_changes;
+       release_revisions(&rev);
+       return (has_changes != 0);
 }
 
 static struct strbuf *idiff_prefix_cb(struct diff_options *opt, void *data)