]> git.proxmox.com Git - libgit2.git/commitdiff
Fix issue with ignoring whole directories
authorRussell Belfer <arrbee@arrbee.com>
Tue, 31 Jan 2012 22:02:52 +0000 (14:02 -0800)
committerRussell Belfer <arrbee@arrbee.com>
Tue, 31 Jan 2012 22:02:52 +0000 (14:02 -0800)
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.

src/attr_file.c

index 74b2b6d125391f860106a425ed66c66fdbddf59d..7911381ea515825d5845a3d4a3cde744c8589e5b 100644 (file)
@@ -200,6 +200,8 @@ int git_attr_fnmatch__match(
 
        if (match->flags & GIT_ATTR_FNMATCH_FULLPATH)
                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
                matched = p_fnmatch(match->pattern, path->basename, 0);