]> git.ipfire.org Git - thirdparty/git.git/commit
repo-settings: introduce function to clear struct
authorPatrick Steinhardt <ps@pks.im>
Fri, 7 Feb 2025 11:03:38 +0000 (12:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Feb 2025 21:54:11 +0000 (13:54 -0800)
commitb411ed60c7438eda3fd85a308050e88159f275fd
tree051e974975806fc76199efe7fbe3693b7dc03a9c
parent88dd321cfedc6ee190dfafe4670a83ea33cdf4a3
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>
repo-settings.c
repo-settings.h
repository.c