Commit e4eb94a2 by Russell Belfer

Fix issue with ignoring whole directories

Now that is_dir is calculated correctly for attr/ignore paths,
it is possible to use it so that ignoring "dir/" will properly
match the directory name and ignore the entire directory.
parent adc9bdb3
...@@ -200,6 +200,8 @@ int git_attr_fnmatch__match( ...@@ -200,6 +200,8 @@ int git_attr_fnmatch__match(
if (match->flags & GIT_ATTR_FNMATCH_FULLPATH) if (match->flags & GIT_ATTR_FNMATCH_FULLPATH)
matched = p_fnmatch(match->pattern, path->path, FNM_PATHNAME); matched = p_fnmatch(match->pattern, path->path, FNM_PATHNAME);
else if (path->is_dir)
matched = p_fnmatch(match->pattern, path->basename, FNM_LEADING_DIR);
else else
matched = p_fnmatch(match->pattern, path->basename, 0); matched = p_fnmatch(match->pattern, path->basename, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment