aboutsummaryrefslogtreecommitdiff
path: root/Documentation/config
diff options
context:
space:
mode:
authorAdrian Ratiu <adrian.ratiu@collabora.com>2026-03-25 21:54:57 +0200
committerJunio C Hamano <gitster@pobox.com>2026-03-25 14:00:46 -0700
commita8b1ba86d494ea8825292c91c243e5d84fd7ee2c (patch)
tree728b1bcaadeff06afdf8a575b797879a3901b799 /Documentation/config
parent4d10f4a9527e664e001b9747b1daff6681b3f807 (diff)
downloadgit-a8b1ba86d494ea8825292c91c243e5d84fd7ee2c.tar.xz
hook: replace hook_list_clear() -> string_list_clear_func()
Replace the custom function with string_list_clear_func() which is a more common pattern for clearing a string_list. To be able to do this, rework hook_clear() into hook_free(), so it can be passed to string_list_clear_func(). A slight complication is the need to keep a copy of the internal cb data free() pointer, however I think it's worth it since the API becomes cleaner, e.g. no more calls with NULL function args like hook_list_clear(hooks, NULL). In other words, the callers don't need to keep track of hook internal state to determine when cleanup is necessary or not (pass NULL) because each `struct hook` now owns its data_free callback. Suggested-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/config')
0 files changed, 0 insertions, 0 deletions