Skip to content

Commit feeb0b1

Browse files
jsyrjalaclaude
andcommitted
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) <noreply@anthropic.com>
1 parent 75b5dcb commit feeb0b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pipeline/pass_githistory.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ static int parse_git_log(const char *repo_path, commit_t **out, int *out_count)
168168

169169
/* Diff parent_tree → tree to find changed files */
170170
git_diff *diff = NULL;
171-
git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT;
171+
git_diff_options diff_opts;
172+
git_diff_options_init(&diff_opts, GIT_DIFF_OPTIONS_VERSION);
172173
if (git_diff_tree_to_tree(&diff, repo, parent_tree, tree, &diff_opts) == 0) {
173174
commit_t current = {0};
174175

0 commit comments

Comments
 (0)