Skip to content

fix: handle corrupt git index errors in sanity check#5085

Open
Kcstring wants to merge 1 commit intoAider-AI:mainfrom
Kcstring:fix-corrupt-index-sanity-check
Open

fix: handle corrupt git index errors in sanity check#5085
Kcstring wants to merge 1 commit intoAider-AI:mainfrom
Kcstring:fix-corrupt-index-sanity-check

Conversation

@Kcstring
Copy link
Copy Markdown

Summary

  • catch non-GitPython exceptions raised while probing tracked files in sanity_check_repo()
  • surface corrupt git index errors as the existing repository corruption message instead of crashing
  • add a regression test for the struct.error path seen with damaged indexes

Testing

  • python3 -m pytest tests/basic/test_sanity_check_repo.py -k "corrupt_git_index or corrupt_repo or git_index_version_greater_than_2"
  • python3 -m ruff check aider/main.py tests/basic/test_sanity_check_repo.py

Fixes #5061

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uncaught error in fun.py line 263

1 participant