]> git.ipfire.org Git - thirdparty/git.git/commitdiff
revisions API users: use release_revisions() for "prune_data" users
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 13 Apr 2022 20:01:44 +0000 (22:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Apr 2022 06:56:09 +0000 (23:56 -0700)
Use release_revisions() for users of "struct rev_list" that reach into
the "struct rev_info" and clear the "prune_data" already.

In a subsequent commit we'll teach release_revisions() to clear this
itself, but in the meantime let's invoke release_revisions() here to
clear anything else we may have missed, and for reasons of having
consistent boilerplate.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/add.c
diff-lib.c
wt-status.c

index f507d2191cd43507a5d360a7b5fbf84f71d64976..115a26ea6331f8182f083a390dd61a704d009672 100644 (file)
@@ -143,6 +143,7 @@ int add_files_to_cache(const char *prefix,
        rev.max_count = 0; /* do not compare unmerged paths with stage #2 */
        run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
        clear_pathspec(&rev.prune_data);
+       release_revisions(&rev);
        return !!data.add_errors;
 }
 
index d6800274bd51b300847a63965e149b04d9545fab..0f16281253fe6b522757a693d9acc2be1cf5454d 100644 (file)
@@ -642,6 +642,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;
 }
 
index f91006213755182c55d9def94e93a85ad47793a6..a14fad1e03aeca76bd1d78491a6067f88723ec0c 100644 (file)
@@ -617,6 +617,7 @@ static void wt_status_collect_changes_worktree(struct wt_status *s)
        copy_pathspec(&rev.prune_data, &s->pathspec);
        run_diff_files(&rev, 0);
        clear_pathspec(&rev.prune_data);
+       release_revisions(&rev);
 }
 
 static void wt_status_collect_changes_index(struct wt_status *s)