summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-06-11 07:17:34 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-11 07:17:34 +0200
commitfa934fabf76c06e843e9bb22d6679b3e882c3e4e (patch)
tree6b97465bbccfbbe7ad4171250f5633fe043f45dc /include/git2
parent3fcfede184535274999cbdf7afbbf457fc6987b5 (diff)
parent2eecc2886be68496bb9555e4c93e59e985a7d09f (diff)
downloadlibgit2-fa934fabf76c06e843e9bb22d6679b3e882c3e4e.tar.gz
Merge pull request #3205 from ethomson/crlf_query
Introduce `git_filter_list_contains`
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/filter.h16
1 files changed, 16 insertions, 0 deletions
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
@@ -96,6 +96,22 @@ GIT_EXTERN(int) git_filter_list_load(
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.
*
* See `git2/buffer.h` for background on `git_buf` objects.