Skip to content

main: handle NoSuchPathError from git.Repo when path resolution fails#5099

Open
SAY-5 wants to merge 1 commit intoAider-AI:mainfrom
SAY-5:say5/get-git-root-no-such-path-2957
Open

main: handle NoSuchPathError from git.Repo when path resolution fails#5099
SAY-5 wants to merge 1 commit intoAider-AI:mainfrom
SAY-5:say5/get-git-root-no-such-path-2957

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 2, 2026

Fixes #2957.

get_git_root only catches InvalidGitRepositoryError and FileNotFoundError. Windows paths containing $ (e.g. F:\\$data\\python\\... from mklink /D directory junctions) reach git.Repo(search_parent_directories=True) and fall through with NoSuchPathError instead, which escapes the handler and crashes aider on startup. Add git.NoSuchPathError to the except tuple so aider just falls through to the no-repo path the same way it already does for invalid-repo / missing-file cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uncaught NoSuchPathError in base.py line 236

1 participant