mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
fix: handle GitCommandNotFound exception in make_new_repo function
This commit is contained in:
parent
653f0c77ef
commit
1a5a618608
2 changed files with 2 additions and 2 deletions
|
@ -57,7 +57,7 @@ def make_new_repo(git_root, io):
|
||||||
try:
|
try:
|
||||||
repo = git.Repo.init(git_root)
|
repo = git.Repo.init(git_root)
|
||||||
check_gitignore(git_root, io, False)
|
check_gitignore(git_root, io, False)
|
||||||
except gitdb.exc.ODBError as err: # issue #1233
|
except (gitdb.exc.ODBError, git.exc.GitCommandNotFound) as err: # issue #1233
|
||||||
io.tool_error(f"Unable to create git repo in {git_root}")
|
io.tool_error(f"Unable to create git repo in {git_root}")
|
||||||
io.tool_error(str(err))
|
io.tool_error(str(err))
|
||||||
return
|
return
|
||||||
|
|
|
@ -625,7 +625,7 @@ class TestMain(TestCase):
|
||||||
mock_git_init.side_effect = git.exc.GitCommandNotFound("git", "Command 'git' not found")
|
mock_git_init.side_effect = git.exc.GitCommandNotFound("git", "Command 'git' not found")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = main(["--exit"], input=DummyInput(), output=DummyOutput())
|
result = main(["--exit", "--yes"], input=DummyInput(), output=DummyOutput())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fail(f"main() raised an unexpected exception: {e}")
|
self.fail(f"main() raised an unexpected exception: {e}")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue