From e3a2a04ceff1d3657629fd6a7245d9a9fc53f24b Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Fri, 18 Apr 2014 14:29:58 -0700 Subject: Preload attribute files that may contain macros There was a latent bug where files that use macro definitions could be parsed before the macro definitions were loaded. Because of attribute file caching, preloading files that are going to be used doesn't add a significant amount of overhead, so let's always preload any files that could contain macros before we assemble the actual vector of files to scan for attributes. --- src/attr_file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/attr_file.c') diff --git a/src/attr_file.c b/src/attr_file.c index 65bbf78e8..8a8d86a2d 100644 --- a/src/attr_file.c +++ b/src/attr_file.c @@ -248,9 +248,7 @@ int git_attr_file__parse_buffer( repo, &attrs->pool, &rule->assigns, &scan))) { if (rule->match.flags & GIT_ATTR_FNMATCH_MACRO) - /* should generate error/warning if this is coming from any - * file other than .gitattributes at repo root. - */ + /* TODO: warning if macro found in file below repo root */ error = git_attr_cache__insert_macro(repo, rule); else error = git_vector_insert(&attrs->rules, rule); -- cgit v1.2.3