mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-20 02:18:13 +00:00
1 parent
07e1f66eba
commit
3929edede5
1 file changed
+8
-4
@@ -165,10 +165,14 @@ class GitignoreParser:
|
|||||||
|
|
||||||
def scan(abs_path: str | None) -> Iterator[str]:
|
def scan(abs_path: str | None) -> Iterator[str]:
|
||||||
for entry in os.scandir(abs_path):
|
for entry in os.scandir(abs_path):
|
||||||
if entry.is_dir(follow_symlinks=follow_symlinks):
|
try:
|
||||||
queue.append(entry.path)
|
if entry.is_dir(follow_symlinks=follow_symlinks):
|
||||||
elif entry.is_file(follow_symlinks=follow_symlinks) and entry.name == ".gitignore":
|
queue.append(entry.path)
|
||||||
yield entry.path
|
elif entry.is_file(follow_symlinks=follow_symlinks) and entry.name == ".gitignore":
|
||||||
|
yield entry.path
|
||||||
|
except PermissionError as ex:
|
||||||
|
log.debug(f"Skipping entry due to permission error: {entry.path}", exc_info=ex)
|
||||||
|
continue
|
||||||
|
|
||||||
while queue:
|
while queue:
|
||||||
next_abs_path = queue.pop(0)
|
next_abs_path = queue.pop(0)
|
||||||
|
|||||||
Reference in new issue
Block a user