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

Function _git_metadata

tests/evals/_common.py:70–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68
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"]),
85 "dirty": bool(run_git(["status", "--porcelain"])),
86 }
87
88
89def _load_summary(run_dir: Path) -> dict[str, Any]:

Callers 2

run_benchFunction · 0.90
render_runFunction · 0.90

Calls 1

run_gitFunction · 0.85

Tested by

no test coverage detected