fix: Handle FileNotFoundError in get_git_root function

This commit is contained in:
Paul Gauthier 2024-09-20 11:45:48 -07:00 committed by Paul Gauthier (aider)
parent 7d766d53ee
commit 8349cd5c15

View file

@ -31,7 +31,7 @@ def get_git_root():
try:
repo = git.Repo(search_parent_directories=True)
return repo.working_tree_dir
except git.InvalidGitRepositoryError:
except (git.InvalidGitRepositoryError, FileNotFoundError):
return None