summaryrefslogtreecommitdiff
path: root/src/attrcache.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/attrcache.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/attrcache.c')
-rw-r--r--src/attrcache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/attrcache.c b/src/attrcache.c
index b4579bfc0..f75edad68 100644
--- a/src/attrcache.c
+++ b/src/attrcache.c
@@ -196,6 +196,7 @@ cleanup:
int git_attr_cache__get(
git_attr_file **out,
git_repository *repo,
+ git_attr_session *attr_session,
git_attr_file_source source,
const char *base,
const char *filename,
@@ -211,8 +212,8 @@ int git_attr_cache__get(
return error;
/* load file if we don't have one or if existing one is out of date */
- if (!file || (error = git_attr_file__out_of_date(repo, file)) > 0)
- error = git_attr_file__load(&updated, repo, entry, source, parser);
+ if (!file || (error = git_attr_file__out_of_date(repo, attr_session, file)) > 0)
+ error = git_attr_file__load(&updated, repo, attr_session, entry, source, parser);
/* if we loaded the file, insert into and/or update cache */
if (updated) {