diff options
| author | Adrian Ratiu <adrian.ratiu@collabora.com> | 2026-03-25 21:54:54 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-25 14:00:45 -0700 |
| commit | b06770e5d8948c7cad76d7507423376eacf1e005 (patch) | |
| tree | a7f33c56ab99bdaa551b23c99583257e381f5fbd /hook.h | |
| parent | 6b9f9e2d2f3d9d6634e72d190e800f65f9a88f30 (diff) | |
| download | git-b06770e5d8948c7cad76d7507423376eacf1e005.tar.xz | |
hook: fix minor style issues
Fix some minor style nits pointed out by Patrick, Junio and Eric:
* Use CALLOC_ARRAY instead of xcalloc.
* Init struct members during declaration.
* Simplify if condition boolean logic.
* Missing curly braces in if/else stmts.
* Unnecessary header includes.
* Capitalization and full-stop in error/warn messages.
* Curly brace on separate line when defining struct.
* Comment spelling: free'd -> freed.
* Sort the included headers.
* Blank line fixes to improve readability.
These contain no logic changes, the code behaves the same as before.
Suggested-by: Eric Sunshine <sunshine@sunshineco.com>
Suggested-by: Junio C Hamano <gitster@pobox.com>
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 'hook.h')
| -rw-r--r-- | hook.h | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,9 +1,9 @@ #ifndef HOOK_H #define HOOK_H -#include "strvec.h" #include "run-command.h" #include "string-list.h" #include "strmap.h" +#include "strvec.h" struct repository; @@ -46,8 +46,7 @@ struct hook { typedef void (*cb_data_free_fn)(void *data); typedef void *(*cb_data_alloc_fn)(void *init_ctx); -struct run_hooks_opt -{ +struct run_hooks_opt { /* Environment vars to be set for each hook */ struct strvec env; |
