From 9f779aacdd950fd53a407da615ca60d628e31d35 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Thu, 29 Jan 2015 14:40:55 -0600 Subject: 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. --- src/attrcache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/attrcache.c') 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) { -- cgit v1.2.1