Skip to content

Commit f0cb6b8

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bf1b32d commit f0cb6b8

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

builtin/add.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ int add_files_to_cache(const char *prefix,
143143
rev.max_count = 0; /* do not compare unmerged paths with stage #2 */
144144
run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
145145
clear_pathspec(&rev.prune_data);
146+
release_revisions(&rev);
146147
return !!data.add_errors;
147148
}
148149

diff-lib.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt)
642642
if (diff_cache(&revs, tree_oid, NULL, 1))
643643
exit(128);
644644
clear_pathspec(&revs.prune_data);
645+
release_revisions(&revs);
645646
return 0;
646647
}
647648

wt-status.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ static void wt_status_collect_changes_worktree(struct wt_status *s)
617617
copy_pathspec(&rev.prune_data, &s->pathspec);
618618
run_diff_files(&rev, 0);
619619
clear_pathspec(&rev.prune_data);
620+
release_revisions(&rev);
620621
}
621622

622623
static void wt_status_collect_changes_index(struct wt_status *s)

0 commit comments

Comments
 (0)