From c67699a1545cfde182a408e761c8b635d8cc1fcc Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 30 Aug 2024 06:55:50 -0700 Subject: [PATCH] fixes #1233 --- aider/main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/aider/main.py b/aider/main.py index 335ffcddb..7a950d9f6 100644 --- a/aider/main.py +++ b/aider/main.py @@ -53,9 +53,15 @@ def guessed_wrong_repo(io, git_root, fnames, git_dname): def make_new_repo(git_root, io): - repo = git.Repo.init(git_root) + try: + repo = git.Repo.init(git_root) + check_gitignore(git_root, io, False) + except git.exc.GitCommandError as err: # issue #1233 + io.tool_error(f"Unable to create git repo in {git_root}") + io.tool_error(str(err)) + return + io.tool_output(f"Git repository created in {git_root}") - check_gitignore(git_root, io, False) return repo