MCPcopy
hub / github.com/pydantic/pydantic / git_revision

Function git_revision

pydantic/_internal/_git.py:25–27  ·  view source on GitHub ↗

Get the SHA-1 of the HEAD of a git repository.

(dir: Path)

Source from the content-addressed store, hash-verified

23
24
25def git_revision(dir: Path) -> str:
26 """Get the SHA-1 of the HEAD of a git repository."""
27 return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], cwd=dir).decode('utf-8').strip()

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected