diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ignore.c | 17 | ||||
-rw-r--r-- | src/status.c | 10 |
2 files changed, 18 insertions, 9 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; +} + diff --git a/src/status.c b/src/status.c index 8e462552e..3d3d15d77 100644 --- a/src/status.c +++ b/src/status.c @@ -243,14 +243,6 @@ int git_status_should_ignore( 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; + return git_ignore_path_is_ignored(ignored, repo, path); } |