From feeb0b1602d0ced719854ae16093e873c13e0764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juha=20Syrj=C3=A4l=C3=A4?= Date: Sat, 21 Mar 2026 17:11:48 +0200 Subject: [PATCH] Fix build error with libgit2 -Wmissing-field-initializers Build fails at pass_githistory.c:171 with: error: missing field 'interhunk_lines' initializer [-Werror,-Wmissing-field-initializers] git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT; codebase-memory-mcp at 75b5dcb has this issue. The GIT_DIFF_OPTIONS_INIT macro does not list all struct fields, which clang flags as an error under -Werror. Replace the macro with the runtime git_diff_options_init() API, which properly initializes all fields. Available since libgit2 0.28. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/pipeline/pass_githistory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pipeline/pass_githistory.c b/src/pipeline/pass_githistory.c index 7a03504..95112d2 100644 --- a/src/pipeline/pass_githistory.c +++ b/src/pipeline/pass_githistory.c @@ -168,7 +168,8 @@ static int parse_git_log(const char *repo_path, commit_t **out, int *out_count) /* Diff parent_tree → tree to find changed files */ git_diff *diff = NULL; - git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT; + git_diff_options diff_opts; + git_diff_options_init(&diff_opts, GIT_DIFF_OPTIONS_VERSION); if (git_diff_tree_to_tree(&diff, repo, parent_tree, tree, &diff_opts) == 0) { commit_t current = {0};