Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: validate git repos with rev-parse#3247

Merged
neubig merged 2 commits into
OpenHands:mainfrom
he-yufeng:fix/git-validate-dotgit-file
May 27, 2026
Merged

fix: validate git repos with rev-parse#3247
neubig merged 2 commits 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

@all-hands-bot all-hands-bot requested a review from neubig May 17, 2026 12:43
@all-hands-bot

Copy link
Copy Markdown
Collaborator

[Automatic Post]: I have assigned @neubig as a reviewer based on the repository MAINTAINERS file. Thanks in advance for the help!

@all-hands-bot

Copy link
Copy Markdown
Collaborator

[Automatic Post]: This PR seems to be currently waiting for review. @neubig, could you please take a look when you have a chance?

This comment was created by an AI agent (OpenHands) on behalf of the user.

@neubig neubig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@neubig neubig merged commit 6e4adcb into OpenHands:main May 27, 2026
27 checks passed
@simonrosenberg simonrosenberg mentioned this pull request May 27, 2026
7 tasks
adshrc pushed a commit to adshrc/software-agent-sdk that referenced this pull request May 29, 2026
StressTestor pushed a commit to StressTestor/software-agent-sdk that referenced this pull request Jun 1, 2026
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

4 participants