diff options
author | Russell Belfer <arrbee@arrbee.com> | 2012-01-20 23:13:17 +0400 |
---|---|---|
committer | Russell Belfer <arrbee@arrbee.com> | 2012-01-20 23:13:17 +0400 |
commit | 63ab73bec0a54300a48355ee28dd24ebd39e2cd2 (patch) | |
tree | b341b54a3b37d30b799a886f15729f537993e8c7 /src/attr.c | |
parent | 9269ccce143578deec4d4e6e7755068f130abe96 (diff) | |
parent | 83bfbdf593a76c591bb9cbd40cec6fca36c81a9c (diff) |
Merge branch 'fix-subdir-attr-paths' into development
This resolves issue #535 and issue #533.
Diffstat (limited to 'src/attr.c')
-rw-r--r-- | src/attr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/attr.c b/src/attr.c index 984b04ff1..da0f72371 100644 --- a/src/attr.c +++ b/src/attr.c @@ -214,7 +214,7 @@ int git_attr_cache__push_file( git_vector *stack, const char *base, const char *filename, - int (*loader)(git_repository *, const char *, git_attr_file **)) + int (*loader)(git_repository *, const char *, git_attr_file *)) { int error = GIT_SUCCESS; git_attr_cache *cache = &repo->attrcache; @@ -231,11 +231,12 @@ int git_attr_cache__push_file( /* either get attr_file from cache or read from disk */ file = git_hashtable_lookup(cache->files, filename); if (file == NULL && git_path_exists(filename) == GIT_SUCCESS) { - error = (*loader)(repo, filename, &file); + if ((error = git_attr_file__new(&file)) == GIT_SUCCESS) + error = loader(repo, filename, file); add_to_cache = (error == GIT_SUCCESS); } - if (file != NULL) { + if (error == GIT_SUCCESS && file != NULL) { /* add file to vector, if we found it */ error = git_vector_insert(stack, file); |