summaryrefslogtreecommitdiff
path: root/src/ignore.c
diff options
context:
space:
mode:
authorJ Wyman <jeremy.wyman@microsoft.com>2015-03-30 14:07:44 -0700
committerEdward Thomson <ethomson@microsoft.com>2015-04-28 14:24:58 -0400
commit4c09e19a3764a1e5f3340dabf8104dfed32e7673 (patch)
tree8df38e74e802445528d626d37276e8b119a7eb46 /src/ignore.c
parentd969d41547080d5e924d49f44ba5de1ade5b343c (diff)
downloadlibgit2-4c09e19a3764a1e5f3340dabf8104dfed32e7673.tar.gz
Improvements to ignore performance on Windows.
Minimizing the number directory and file opens, minimizes the amount of IO thus reducing the overall cost of performing ignore operations.
Diffstat (limited to 'src/ignore.c')
-rw-r--r--src/ignore.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ignore.c b/src/ignore.c
index 3a5efedce..7ad8500e8 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -388,7 +388,7 @@ static bool ignore_lookup_in_rules(
}
int git_ignore__lookup(
- int *out, git_ignores *ignores, const char *pathname)
+ int *out, git_ignores *ignores, const char *pathname, git_dir_flag dir_flag)
{
unsigned int i;
git_attr_file *file;
@@ -397,7 +397,7 @@ int git_ignore__lookup(
*out = GIT_IGNORE_NOTFOUND;
if (git_attr_path__init(
- &path, pathname, git_repository_workdir(ignores->repo)) < 0)
+ &path, pathname, git_repository_workdir(ignores->repo), dir_flag) < 0)
return -1;
/* first process builtins - success means path was found */
@@ -470,7 +470,7 @@ int git_ignore_path_is_ignored(
memset(&path, 0, sizeof(path));
memset(&ignores, 0, sizeof(ignores));
- if ((error = git_attr_path__init(&path, pathname, workdir)) < 0 ||
+ if ((error = git_attr_path__init(&path, pathname, workdir, GIT_DIR_FLAG_UNKNOWN)) < 0 ||
(error = git_ignore__for_path(repo, path.path, &ignores)) < 0)
goto cleanup;