MCPcopy Index your code
hub / github.com/idank/explainshell / run_git

Function run_git

tests/evals/_common.py:71–81  ·  view source on GitHub ↗
(args: list[str])

Source from the content-addressed store, hash-verified

69
70def _git_metadata() -> dict[str, Any]:
71 def run_git(args: list[str]) -> str | None:
72 result = subprocess.run(
73 ["git", *args],
74 cwd=REPO_ROOT,
75 capture_output=True,
76 text=True,
77 check=False,
78 )
79 if result.returncode != 0:
80 return None
81 return result.stdout.strip()
82
83 return {
84 "commit": run_git(["rev-parse", "--short", "HEAD"]),

Callers 1

_git_metadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected