diff options
author | Russell Belfer <rb@github.com> | 2012-08-22 11:42:00 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-08-22 11:42:00 -0700 |
commit | 2fb4e9b3c5fb410164a32724e42a10d1841d02cc (patch) | |
tree | edb68bc0e0070341ec8f4c7eb27915096858af70 /src/ignore.c | |
parent | f004c4a8a78ec1ac109b0a0c78cdebe47a5df215 (diff) | |
download | libgit2-2fb4e9b3c5fb410164a32724e42a10d1841d02cc.tar.gz |
Wrap up ignore API and add tests
This fills out the ignore API and adds tests.
Diffstat (limited to 'src/ignore.c')
-rw-r--r-- | src/ignore.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ignore.c b/src/ignore.c index b81676b94..1ac8afdf3 100644 --- a/src/ignore.c +++ b/src/ignore.c @@ -235,3 +235,20 @@ int git_ignore_clear_internal_rules( return error; } + +int git_ignore_path_is_ignored( + int *ignored, + git_repository *repo, + const char *path) +{ + int error; + git_ignores ignores; + + if (git_ignore__for_path(repo, path, &ignores) < 0) + return -1; + + error = git_ignore__lookup(&ignores, path, ignored); + git_ignore__free(&ignores); + return error; +} + |