]> git.ipfire.org Git - thirdparty/git.git/commitdiff
hook: rename cb_data_free/alloc -> hook_data_free/alloc
authorAdrian Ratiu <adrian.ratiu@collabora.com>
Wed, 25 Mar 2026 19:54:55 +0000 (21:54 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Mar 2026 21:00:46 +0000 (14:00 -0700)
Rename the hook callback function types to use the hook prefix.

This is a style fix with no logic changes.

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>
hook.c
hook.h

diff --git a/hook.c b/hook.c
index 935237fc1def150258e5d0b588025bbdcdd483e0..4a0db5cfebbf3d265da7138c174f1e0ce6fce4b9 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -52,7 +52,7 @@ const char *find_hook(struct repository *r, const char *name)
        return path.buf;
 }
 
-static void hook_clear(struct hook *h, cb_data_free_fn cb_data_free)
+static void hook_clear(struct hook *h, hook_data_free_fn cb_data_free)
 {
        if (!h)
                return;
@@ -70,7 +70,7 @@ static void hook_clear(struct hook *h, cb_data_free_fn cb_data_free)
        free(h);
 }
 
-void hook_list_clear(struct string_list *hooks, cb_data_free_fn cb_data_free)
+void hook_list_clear(struct string_list *hooks, hook_data_free_fn cb_data_free)
 {
        struct string_list_item *item;
 
diff --git a/hook.h b/hook.h
index 1c447cbb6be83b8e98aa95bf748cfe756c266189..965794a5b85e126114497780cf585ad7697b9a84 100644 (file)
--- a/hook.h
+++ b/hook.h
@@ -43,8 +43,8 @@ struct hook {
        void *feed_pipe_cb_data;
 };
 
-typedef void (*cb_data_free_fn)(void *data);
-typedef void *(*cb_data_alloc_fn)(void *init_ctx);
+typedef void (*hook_data_free_fn)(void *data);
+typedef void *(*hook_data_alloc_fn)(void *init_ctx);
 
 struct run_hooks_opt {
        /* Environment vars to be set for each hook */
@@ -131,14 +131,14 @@ struct run_hooks_opt {
         *
         * The `feed_pipe_ctx` pointer can be used to pass initialization data.
         */
-       cb_data_alloc_fn feed_pipe_cb_data_alloc;
+       hook_data_alloc_fn feed_pipe_cb_data_alloc;
 
        /**
         * Called to free the memory initialized by `feed_pipe_cb_data_alloc`.
         *
         * Must always be provided when `feed_pipe_cb_data_alloc` is provided.
         */
-       cb_data_free_fn feed_pipe_cb_data_free;
+       hook_data_free_fn feed_pipe_cb_data_free;
 };
 
 #define RUN_HOOKS_OPT_INIT { \
@@ -188,7 +188,7 @@ struct string_list *list_hooks(struct repository *r, const char *hookname,
  * Frees the memory allocated for the hook list, including the `struct hook`
  * items and their internal state.
  */
-void hook_list_clear(struct string_list *hooks, cb_data_free_fn cb_data_free);
+void hook_list_clear(struct string_list *hooks, hook_data_free_fn cb_data_free);
 
 /**
  * Frees the hook configuration cache stored in `struct repository`.