File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed
Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,18 @@ typedef struct {
132132#define GIT_BLOB_FILTER_OPTIONS_VERSION 1
133133#define GIT_BLOB_FILTER_OPTIONS_INIT {GIT_BLOB_FILTER_OPTIONS_VERSION, GIT_BLOB_FILTER_CHECK_FOR_BINARY}
134134
135+ /**
136+ * Initialize git_blob_filter_options structure
137+ *
138+ * Initializes a `git_blob_filter_options` with default values. Equivalent
139+ * to creating an instance with `GIT_BLOB_FILTER_OPTIONS_INIT`.
140+ *
141+ * @param opts The `git_blob_filter_options` struct to initialize.
142+ * @param version The struct version; pass `GIT_BLOB_FILTER_OPTIONS_VERSION`.
143+ * @return Zero on success; -1 on failure.
144+ */
145+ GIT_EXTERN (int ) git_blob_filter_options_init (git_blob_filter_options * opts , unsigned int version );
146+
135147/**
136148 * Get a buffer with the filtered content of a blob.
137149 *
Original file line number Diff line number Diff line change @@ -408,6 +408,15 @@ int git_blob_is_binary(const git_blob *blob)
408408 return git_buf_text_is_binary (& content );
409409}
410410
411+ int git_blob_filter_options_init (
412+ git_blob_filter_options * opts ,
413+ unsigned int version )
414+ {
415+ GIT_INIT_STRUCTURE_FROM_TEMPLATE (opts , version ,
416+ git_blob_filter_options , GIT_BLOB_FILTER_OPTIONS_INIT );
417+ return 0 ;
418+ }
419+
411420int git_blob_filter (
412421 git_buf * out ,
413422 git_blob * blob ,
Original file line number Diff line number Diff line change @@ -82,6 +82,11 @@ void test_core_structinit__compare(void)
8282 git_blame_options , GIT_BLAME_OPTIONS_VERSION , \
8383 GIT_BLAME_OPTIONS_INIT , git_blame_options_init );
8484
85+ /* blob_filter_options */
86+ CHECK_MACRO_FUNC_INIT_EQUAL ( \
87+ git_blob_filter_options , GIT_BLOB_FILTER_OPTIONS_VERSION , \
88+ GIT_BLOB_FILTER_OPTIONS_INIT , git_blob_filter_options_init );
89+
8590 /* checkout */
8691 CHECK_MACRO_FUNC_INIT_EQUAL ( \
8792 git_checkout_options , GIT_CHECKOUT_OPTIONS_VERSION , \
You can’t perform that action at this time.
0 commit comments