summaryrefslogtreecommitdiff
path: root/src/ignore.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-01-29 14:40:55 -0600
committerEdward Thomson <ethomson@microsoft.com>2015-02-03 00:31:08 -0500
commit9f779aacdd950fd53a407da615ca60d628e31d35 (patch)
tree55819aa11a18e2d272d75118239d23243b49357a /src/ignore.c
parent60561d54468d7097e04466fd8125be5231cea637 (diff)
downloadlibgit2-9f779aacdd950fd53a407da615ca60d628e31d35.tar.gz
attrcache: don't re-read attrs during checkout
During checkout, assume that the .gitattributes files aren't modified during the checkout. Instead, create an "attribute session" during checkout. Assume that attribute data read in the same checkout "session" hasn't been modified since the checkout started. (But allow subsequent checkouts to invalidate the cache.) Further, cache nonexistent git_attr_file data even when .gitattributes files are not found to prevent re-scanning for nonexistent files.
Diffstat (limited to 'src/ignore.c')
-rw-r--r--src/ignore.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ignore.c b/src/ignore.c
index 6e00f7db5..dd299f076 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -161,7 +161,7 @@ static int push_ignore_file(
git_attr_file *file = NULL;
error = git_attr_cache__get(
- &file, ignores->repo, GIT_ATTR_FILE__FROM_FILE,
+ &file, ignores->repo, NULL, GIT_ATTR_FILE__FROM_FILE,
base, filename, parse_ignore_file);
if (error < 0)
return error;
@@ -189,7 +189,7 @@ static int get_internal_ignores(git_attr_file **out, git_repository *repo)
return error;
error = git_attr_cache__get(
- out, repo, GIT_ATTR_FILE__IN_MEMORY, NULL, GIT_IGNORE_INTERNAL, NULL);
+ out, repo, NULL, GIT_ATTR_FILE__IN_MEMORY, NULL, GIT_IGNORE_INTERNAL, NULL);
/* if internal rules list is empty, insert default rules */
if (!error && !(*out)->rules.length)