From 1b61af8873c2e59be674b2e05ce5a81c1778e567 Mon Sep 17 00:00:00 2001 From: george Date: Sat, 6 Jun 2026 01:04:14 +0100 Subject: [PATCH] Fix DirEntry sort error in discover_files Sort os.scandir() results by entry.name instead of comparing DirEntry objects directly, which don't support < operator. Co-Authored-By: Claude Sonnet 4.6 --- backend/app/git_source.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/git_source.py b/backend/app/git_source.py index c51c461..b553f1e 100644 --- a/backend/app/git_source.py +++ b/backend/app/git_source.py @@ -166,7 +166,7 @@ def discover_files( def walk_and_collect(current: Path, rel_prefix: Path): """Recursive walk function.""" try: - for entry in sorted(os.scandir(current)): + for entry in sorted(os.scandir(current), key=lambda e: e.name): entry_path = current / entry.name rel_path = (rel_prefix / entry.name).replace("\\", "/") if str(rel_prefix) != "." else rel_prefix