repo-settings: introduce function to clear struct
We don't provide a way to clear a `struct repo_settings`, and instead open-code this in `repo_clear()`. This is mixing up concerns and means that developers have to touch multiple files whenever they add a new field to the structure in case the associated resources need to be released. Provide a new `repo_settings_clear()` function to improve this. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
88dd321cfe
commit
b411ed60c7
@ -380,7 +380,7 @@ void repo_clear(struct repository *repo)
|
||||
parsed_object_pool_clear(repo->parsed_objects);
|
||||
FREE_AND_NULL(repo->parsed_objects);
|
||||
|
||||
FREE_AND_NULL(repo->settings.fsmonitor);
|
||||
repo_settings_clear(repo);
|
||||
|
||||
if (repo->config) {
|
||||
git_configset_clear(repo->config);
|
||||
|
Reference in New Issue
Block a user