diff --git a/aider/main.py b/aider/main.py index 87a624921..32d018f32 100644 --- a/aider/main.py +++ b/aider/main.py @@ -25,6 +25,7 @@ from .dump import dump # noqa: F401 def setup_git_home(io): home = Path.home() git_repos = list(home.glob("*/.git")) + git_root = None if git_repos: io.tool_output("Found git repositories in your home directory:") @@ -61,6 +62,9 @@ def setup_git_home(io): else: return # no response + if not git_root: + return + if git_root.exists(): if git_root.is_dir(): os.chdir(git_root)