From 73e7d7bd2aa53a8879bcd67a950bda479b03860f Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 9 Sep 2024 12:42:20 -0700 Subject: [PATCH] fix: handle git errors when listing files in the repository --- aider/repo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aider/repo.py b/aider/repo.py index 96f0639f1..1ed5f49a6 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -257,6 +257,10 @@ class GitRepo: commit = self.repo.head.commit except ValueError: commit = None + except ANY_GIT_ERROR as err: + self.io.tool_error(f"Unable to list files in git repo: {err}") + self.io.tool_output("Is your git repo corrupted?") + return [] files = set() if commit: