fix: Handle git repo initialization errors gracefully

This commit is contained in:
Paul Gauthier 2024-11-11 09:56:19 -08:00 committed by Paul Gauthier (aider)
parent 94a6d3bc7e
commit acfb7c3a89

View file

@ -95,7 +95,10 @@ def setup_git(git_root, io):
repo = None
if git_root:
repo = git.Repo(git_root)
try:
repo = git.Repo(git_root)
except ANY_GIT_ERROR:
pass
elif cwd == Path.home():
io.tool_warning("You should probably run aider in a directory, not your home dir.")
return