kittens/diff: move empty pattern check to dir tree walk
This commit is contained in:
parent
fbf1ec43c7
commit
eea652f1d0
@ -117,10 +117,10 @@ def collect_files(collection: Collection, left: str, right: str) -> None:
|
||||
|
||||
def walk(base: str, names: Set[str], pmap: Dict[str, str]) -> None:
|
||||
for dirpath, dirnames, filenames in os.walk(base):
|
||||
if any(fnmatch(dirpath, f"*/{pat}") for pat in collection.ignore_paths):
|
||||
if any(fnmatch(dirpath, f"*/{pat}") for pat in collection.ignore_paths if pat):
|
||||
continue
|
||||
for filename in filenames:
|
||||
if any(fnmatch(filename, f"{pat}") for pat in collection.file_ignores):
|
||||
if any(fnmatch(filename, f"{pat}") for pat in collection.file_ignores if pat):
|
||||
continue
|
||||
path = os.path.abspath(os.path.join(dirpath, filename))
|
||||
path_name_map[path] = name = os.path.relpath(path, base)
|
||||
|
||||
@ -59,7 +59,7 @@ def syntax_aliases(raw: str) -> Dict[str, str]:
|
||||
|
||||
|
||||
def pattern_list(raw: str) -> List[str]:
|
||||
return [pat for pat in raw.split(' ') if pat]
|
||||
return raw.split(' ')
|
||||
|
||||
|
||||
def parse_map(val: str) -> Iterable[KittensKeyDefinition]:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user