summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMohseen Mukaddam <mohseenmukaddam6@gmail.com>2017-06-13 11:05:40 -0700
committerMohseen Mukaddam <mohseenmukaddam6@gmail.com>2017-06-13 11:05:40 -0700
commita78441bc467f964261f24b2a1d011cc84fc96708 (patch)
tree469e6aed0ecde7f85ee510820afca8249d5a6b4c /src
parent7f7dabdaac2b1f4b4a98cdd882a37017cedd830c (diff)
downloadlibgit2-a78441bc467f964261f24b2a1d011cc84fc96708.tar.gz
Adding git_filter_init for initializing `git_filter` struct + unit test
Diffstat (limited to 'src')
-rw-r--r--src/filter.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/filter.c b/src/filter.c
index e74cc1053..361e08529 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -895,7 +895,7 @@ static int stream_list_init(
git_array_size(filters->filters) - 1 - i : i;
git_filter_entry *fe = git_array_get(filters->filters, filter_idx);
git_writestream *filter_stream;
-
+
assert(fe->filter->stream || fe->filter->apply);
/* If necessary, create a stream that proxies the traditional
@@ -1022,3 +1022,9 @@ int git_filter_list_stream_blob(
return git_filter_list_stream_data(filters, &in, target);
}
+
+int git_filter_init(git_filter *filter, unsigned int version)
+{
+ GIT_INIT_STRUCTURE_FROM_TEMPLATE(filter, version, git_filter, GIT_FILTER_INIT);
+ return 0;
+}