mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
refactor: improve error handling for git version check
This commit is contained in:
parent
00f42590c8
commit
bd21122e64
2 changed files with 6 additions and 2 deletions
|
@ -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.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue