Problem
Build fails on clang with -Werror enabled when using libgit2 1.9.2:
src/pipeline/pass_githistory.c:171:42: error: missing field 'interhunk_lines' initializer
[-Werror,-Wmissing-field-initializers]
git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT;
^
The GIT_DIFF_OPTIONS_INIT macro does not initialize all struct fields, which clang treats as an error under -Werror,-Wmissing-field-initializers.
Fix
Replace the compile-time macro with the runtime API:
// Before (fails):
git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT;
// After (works):
git_diff_options diff_opts;
git_diff_options_init(&diff_opts, GIT_DIFF_OPTIONS_VERSION);
git_diff_options_init() has been available since libgit2 0.28.
Affected file
src/pipeline/pass_githistory.c:171