mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
handle repo index errors
This commit is contained in:
parent
fa5c8a00e4
commit
a341c98ec6
1 changed files with 11 additions and 3 deletions
|
@ -285,9 +285,17 @@ class GitRepo:
|
||||||
files = self.tree_files[commit]
|
files = self.tree_files[commit]
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
for blob in commit.tree.traverse():
|
iterator = commit.tree.traverse()
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
blob = next(iterator)
|
||||||
if blob.type == "blob": # blob is a file
|
if blob.type == "blob": # blob is a file
|
||||||
files.add(blob.path)
|
files.add(blob.path)
|
||||||
|
except (IndexError,) + ANY_GIT_ERROR:
|
||||||
|
self.io.tool_output(f"GitRepo: read error skipping {blob.path}")
|
||||||
|
continue
|
||||||
|
except StopIteration:
|
||||||
|
break
|
||||||
except ANY_GIT_ERROR as err:
|
except ANY_GIT_ERROR as err:
|
||||||
self.git_repo_error = err
|
self.git_repo_error = err
|
||||||
self.io.tool_error(f"Unable to list files in git repo: {err}")
|
self.io.tool_error(f"Unable to list files in git repo: {err}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue