mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
fix: Handle case when current working directory is inaccessible in git setup
This commit is contained in:
parent
5751bcd382
commit
94a6d3bc7e
1 changed files with 4 additions and 2 deletions
|
@ -90,7 +90,7 @@ def setup_git(git_root, io):
|
|||
try:
|
||||
cwd = Path.cwd()
|
||||
except OSError:
|
||||
return None
|
||||
cwd = None
|
||||
|
||||
repo = None
|
||||
|
||||
|
@ -99,7 +99,9 @@ def setup_git(git_root, io):
|
|||
elif cwd == Path.home():
|
||||
io.tool_warning("You should probably run aider in a directory, not your home dir.")
|
||||
return
|
||||
elif io.confirm_ask("No git repo found, create one to track aider's changes (recommended)?"):
|
||||
elif cwd and io.confirm_ask(
|
||||
"No git repo found, create one to track aider's changes (recommended)?"
|
||||
):
|
||||
git_root = str(cwd.resolve())
|
||||
repo = make_new_repo(git_root, io)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue