Skip to content

fix: validate git repos with rev-parse#3247

Open
he-yufeng wants to merge 1 commit into
OpenHands:mainfrom
he-yufeng:fix/git-validate-dotgit-file
Open

fix: validate git repos with rev-parse#3247
he-yufeng wants to merge 1 commit into
OpenHands:mainfrom
he-yufeng:fix/git-validate-dotgit-file

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

  • validate git workspaces by running git rev-parse --git-dir even when .git exists
  • keep nested broken repositories from crashing /api/git/changes
  • make the existing nested-repo assertion path-separator neutral on Windows

Fixes #2892.

To verify

  • python -m py_compile openhands-sdk\openhands\sdk\git\utils.py tests\sdk\git\test_git_changes.py
  • python -m ruff check openhands-sdk\openhands\sdk\git\utils.py tests\sdk\git\test_git_changes.py
  • python -m ruff format --check openhands-sdk\openhands\sdk\git\utils.py tests\sdk\git\test_git_changes.py
  • python -m pytest tests\sdk\git\test_git_changes.py -q

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.

GET /api/git/changes returns 500 on Windows — .git existence check bypasses git validation, crashes on volume mounts

1 participant