File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -272,16 +272,14 @@ def self_owned(path):
272272 return get_osusername () == find_owner (os .path .abspath (path ))
273273
274274
275- def is_ignored (filename : str , ignore_globs : List [str ] = None ) -> bool :
275+ def is_ignored (filename : str , ignore_globs : List [str ]) -> bool :
276276 """Determines whether a filename should be ignored, based on whether it
277277 matches any file glob in the given list. Note that this only matches on the
278278 base filename itself, not the full path."""
279- if ignore_globs is None :
280- return False
281- dirname = os .path .dirname (filename )
279+
280+ basename = os .path .basename (filename )
282281 for expr in ignore_globs :
283- globs = glob .glob (os .path .join (dirname , expr ))
284- if filename in globs :
282+ if fnmatch .fnmatch (basename , expr ):
285283 return True
286284 return False
287285
You can’t perform that action at this time.
0 commit comments