mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-12 22:14:54 +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]:
|
||||
for entry in os.scandir(abs_path):
|
||||
if entry.is_dir(follow_symlinks=follow_symlinks):
|
||||
queue.append(entry.path)
|
||||
elif entry.is_file(follow_symlinks=follow_symlinks) and entry.name == ".gitignore":
|
||||
yield entry.path
|
||||
try:
|
||||
if entry.is_dir(follow_symlinks=follow_symlinks):
|
||||
queue.append(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:
|
||||
next_abs_path = queue.pop(0)
|
||||
|
||||
Reference in new issue
Block a user