revisions API users: use release_revisions() for "prune_data" users
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>
Ævar Arnfjörð Bjarmason committed
Apr 13, 2022 at 22:01 UTC
f0cb6b8053eb9146e9d5255b6b0473d020c6e8bd
3 files changed
+3
builtin/add.c
+1
@@ -143,6 +143,7 @@ int add_files_to_cache(const char *prefix,
143
rev.max_count = 0; /* do not compare unmerged paths with stage #2 */
144
run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
145
clear_pathspec(&rev.prune_data);
146
+ release_revisions(&rev);
147
return !!data.add_errors;
148
}
149
diff-lib.c
+1
@@ -642,6 +642,7 @@ int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt)
642
if (diff_cache(&revs, tree_oid, NULL, 1))
643
exit(128);
644
clear_pathspec(&revs.prune_data);
645
+ release_revisions(&revs);
646
return 0;
647
}
648
wt-status.c
+1
@@ -617,6 +617,7 @@ static void wt_status_collect_changes_worktree(struct wt_status *s)
617
copy_pathspec(&rev.prune_data, &s->pathspec);
618
run_diff_files(&rev, 0);
619
clear_pathspec(&rev.prune_data);
620
+ release_revisions(&rev);
621
}
622
623
static void wt_status_collect_changes_index(struct wt_status *s)