diff options
| author | Russell Belfer <arrbee@arrbee.com> | 2012-02-01 12:30:35 -0800 |
|---|---|---|
| committer | Russell Belfer <arrbee@arrbee.com> | 2012-02-01 12:30:35 -0800 |
| commit | e8c96ed2a74a4fcd9789721b4ebfd78586b3a16f (patch) | |
| tree | 9cb7c7a096c76c8b0ec05289c42ffff2baef042c /src/attr.c | |
| parent | 62a1f713de384e141045facf3c1a53d9642e8eb5 (diff) | |
| download | libgit2-e8c96ed2a74a4fcd9789721b4ebfd78586b3a16f.tar.gz | |
Add unit tests for recent bug fixes
Add unit tests to confirm ignore directory pattern matches and
to confirm that ignore and attribute files are loaded properly
into the attribute file cache.
Diffstat (limited to 'src/attr.c')
| -rw-r--r-- | src/attr.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/attr.c b/src/attr.c index ddcc3dcf0..17571f6a8 100644 --- a/src/attr.c +++ b/src/attr.c @@ -210,6 +210,13 @@ int git_attr_add_macro( return error; } +int git_attr_cache__is_cached(git_repository *repo, const char *path) +{ + const char *cache_key = path; + if (repo && git__prefixcmp(cache_key, git_repository_workdir(repo)) == 0) + cache_key += strlen(git_repository_workdir(repo)); + return (git_hashtable_lookup(repo->attrcache.files, cache_key) == NULL); +} /* add git_attr_file to vector of files, loading if needed */ int git_attr_cache__push_file( |
