mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
fix: Handle ANY_GIT_ERROR when reading staged files in repo.py
This commit is contained in:
parent
ad4bd91751
commit
38acbf6970
1 changed files with 5 additions and 3 deletions
|
@ -309,9 +309,11 @@ class GitRepo:
|
|||
|
||||
# Add staged files
|
||||
index = self.repo.index
|
||||
# index.entries.keys can throw ANY_GIT_ERROR ai!
|
||||
try:
|
||||
staged_files = [path for path, _ in index.entries.keys()]
|
||||
files.update(self.normalize_path(path) for path in staged_files)
|
||||
except ANY_GIT_ERROR as err:
|
||||
self.io.tool_error(f"Unable to read staged files: {err}")
|
||||
|
||||
res = [fname for fname in files if not self.ignored_file(fname)]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue