Skip to content

Support git show object specs#4445

Open
oaslananka wants to merge 1 commit into
modelcontextprotocol:mainfrom
oaslananka:fix/git-show-object-spec
Open

Support git show object specs#4445
oaslananka wants to merge 1 commit into
modelcontextprotocol:mainfrom
oaslananka:fix/git-show-object-spec

Conversation

@oaslananka

Copy link
Copy Markdown

Summary

  • Support Git object specs such as HEAD:path/to/file in git_show.
  • Preserve the existing formatted commit output for normal commit revisions.
  • Add a regression test for showing a nested blob through HEAD:logic/position_realtime_infos.py.

Fixes #1682

Tests

  • python -m pytest tests/test_server.py::test_git_show_blob_object_spec tests/test_server.py::test_git_show tests/test_server.py::test_git_show_initial_commit tests/test_server.py::test_git_show_rejects_flag_injection tests/test_server.py::test_git_show_rejects_malicious_refs -q
  • python -m pytest tests/test_server.py -q
  • python -m py_compile src/mcp_server_git/server.py
  • git diff --check

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.

[Git MCP] Blob or Tree named 'XXX.py^0' not found

1 participant