diff options
| author | Philip Kelley <phkelley@hotmail.com> | 2012-09-17 15:42:41 -0400 |
|---|---|---|
| committer | Philip Kelley <phkelley@hotmail.com> | 2012-09-17 15:42:41 -0400 |
| commit | ec40b7f99f7f7161b0a1b24f1d8a934ec0eaacb1 (patch) | |
| tree | 59744c10038258c3993a4eb1b1dfc3896c35b97a /src/attr_file.c | |
| parent | e8776d30f7edb570f435cf746d712c696b862bdd (diff) | |
| download | libgit2-ec40b7f99f7f7161b0a1b24f1d8a934ec0eaacb1.tar.gz | |
Support for core.ignorecase
Diffstat (limited to 'src/attr_file.c')
| -rw-r--r-- | src/attr_file.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/attr_file.c b/src/attr_file.c index b2f312e3e..ca8bdd89d 100644 --- a/src/attr_file.c +++ b/src/attr_file.c @@ -53,7 +53,7 @@ fail: } int git_attr_file__parse_buffer( - git_repository *repo, const char *buffer, git_attr_file *attrs) + git_repository *repo, void *parsedata, const char *buffer, git_attr_file *attrs) { int error = 0; const char *scan = NULL; @@ -123,7 +123,7 @@ int git_attr_file__new_and_load( if (!(error = git_futils_readbuffer(&content, path))) error = git_attr_file__parse_buffer( - NULL, git_buf_cstr(&content), *attrs_ptr); + NULL, NULL, git_buf_cstr(&content), *attrs_ptr); git_buf_free(&content); @@ -207,16 +207,17 @@ bool git_attr_fnmatch__match( const git_attr_path *path) { int fnm; + int icase_flags = (match->flags & GIT_ATTR_FNMATCH_ICASE) ? FNM_CASEFOLD : 0; if (match->flags & GIT_ATTR_FNMATCH_DIRECTORY && !path->is_dir) return false; if (match->flags & GIT_ATTR_FNMATCH_FULLPATH) - fnm = p_fnmatch(match->pattern, path->path, FNM_PATHNAME); + fnm = p_fnmatch(match->pattern, path->path, FNM_PATHNAME | icase_flags); else if (path->is_dir) - fnm = p_fnmatch(match->pattern, path->basename, FNM_LEADING_DIR); + fnm = p_fnmatch(match->pattern, path->basename, FNM_LEADING_DIR | icase_flags); else - fnm = p_fnmatch(match->pattern, path->basename, 0); + fnm = p_fnmatch(match->pattern, path->basename, icase_flags); return (fnm == FNM_NOMATCH) ? false : true; } |
