handle the case of no git repo

This commit is contained in:
Paul Gauthier 2023-09-27 18:37:26 -07:00
parent 1d0d91d71e
commit 82d7f04865

View file

@ -74,9 +74,12 @@ def check_gitignore(git_root, io, ask=True):
if not git_root:
return
repo = git.Repo(git_root)
if repo.ignored(".aider"):
return
try:
repo = git.Repo(git_root)
if repo.ignored(".aider"):
return
except git.exc.InvalidGitRepositoryError:
pass
pat = ".aider*"