diff --git a/aider/main.py b/aider/main.py index 5b0ab6dfa..be90d8776 100644 --- a/aider/main.py +++ b/aider/main.py @@ -307,8 +307,12 @@ def sanity_check_repo(repo, io): error_msg = str(repo.git_repo_error) except ANY_GIT_ERROR as exc: error_msg = str(exc) + bad_ver = "version in (1, 2)" in error_msg + except AssertionError as exc: + error_msg = str(exc) + bad_ver = True - if "version in (1, 2)" in error_msg: + if bad_ver: io.tool_error("Aider only works with git repos with version number 1 or 2.") io.tool_output("You may be able to convert your repo: git update-index --index-version=2") io.tool_output("Or run aider --no-git to proceed without using git.") diff --git a/aider/repo.py b/aider/repo.py index 69a5a3c52..7416c4d40 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -10,7 +10,7 @@ from aider.sendchat import simple_send_with_retries from .dump import dump # noqa: F401 -ANY_GIT_ERROR = (git.exc.ODBError, git.exc.GitError, OSError, AssertionError) +ANY_GIT_ERROR = (git.exc.ODBError, git.exc.GitError, OSError) class GitRepo: