From a08a557b4a2768c05806064d673b8b82d2979748 Mon Sep 17 00:00:00 2001 From: SAY-5 Date: Sat, 2 May 2026 14:09:46 -0700 Subject: [PATCH 1/2] main: handle NoSuchPathError from git.Repo when path resolution fails Signed-off-by: SAY-5 --- aider/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aider/main.py b/aider/main.py index afb3f836624..d91cc19dde0 100644 --- a/aider/main.py +++ b/aider/main.py @@ -62,7 +62,12 @@ def get_git_root(): try: repo = git.Repo(search_parent_directories=True) return repo.working_tree_dir - except (git.InvalidGitRepositoryError, FileNotFoundError): + except (git.InvalidGitRepositoryError, git.NoSuchPathError, FileNotFoundError): + # Windows paths containing `$` (e.g. `F:\$data\...` from + # `mklink /D`-style mounts) reach here as `NoSuchPathError` + # because git-python resolves them through the parent search and + # fails the existence check (#2957). Treat the same as no repo — + # aider operates without one — instead of crashing on startup. return None From 5b9ba1511c241a079d33bb1ae6d716bdbcd6fa41 Mon Sep 17 00:00:00 2001 From: SAY-5 Date: Mon, 11 May 2026 12:59:15 -0700 Subject: [PATCH 2/2] chore: remove em-dashes from comments --- aider/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/main.py b/aider/main.py index d91cc19dde0..84d3b58b302 100644 --- a/aider/main.py +++ b/aider/main.py @@ -66,8 +66,8 @@ def get_git_root(): # Windows paths containing `$` (e.g. `F:\$data\...` from # `mklink /D`-style mounts) reach here as `NoSuchPathError` # because git-python resolves them through the parent search and - # fails the existence check (#2957). Treat the same as no repo — - # aider operates without one — instead of crashing on startup. + # fails the existence check (#2957). Treat the same as no repo, + # aider operates without one, instead of crashing on startup. return None