From 2eecc2886be68496bb9555e4c93e59e985a7d09f Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Wed, 10 Jun 2015 14:43:49 -0400 Subject: Introduce `git_filter_list_contains` `git_filter_list_contains` can be used to query a filter list to determine if a given filter will be run. --- include/git2/filter.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/git2/filter.h b/include/git2/filter.h index dc59e6341..1828903e4 100644 --- a/include/git2/filter.h +++ b/include/git2/filter.h @@ -95,6 +95,22 @@ GIT_EXTERN(int) git_filter_list_load( git_filter_mode_t mode, uint32_t flags); +/** + * Query the filter list to see if a given filter (by name) will run. + * The built-in filters "crlf" and "ident" can be queried, otherwise this + * is the name of the filter specified by the filter attribute. + * + * This will return 0 if the given filter is not in the list, or 1 if + * the filter will be applied. + * + * @param filters A loaded git_filter_list (or NULL) + * @param name The name of the filter to query + * @return 1 if the filter is in the list, 0 otherwise + */ +GIT_EXTERN(int) git_filter_list_contains( + git_filter_list *filters, + const char *name); + /** * Apply filter list to a data buffer. * -- cgit v1.2.1