MCPcopy Create free account
hub / github.com/espnet/espnet / _run_git_command

Function _run_git_command

espnet3/utils/logging_utils.py:307–319  ·  view source on GitHub ↗

Run a git command and return stdout, or None on failure.

(cmd: list[str], cwd: Path | None)

Source from the content-addressed store, hash-verified

305# Run Metadata (Command/Git/Requirements)
306# =============================================================================
307def _run_git_command(cmd: list[str], cwd: Path | None) -> str | None:
308 """Run a git command and return stdout, or None on failure."""
309 try:
310 completed = subprocess.run(
311 cmd,
312 cwd=cwd,
313 check=True,
314 capture_output=True,
315 text=True,
316 )
317 return completed.stdout.strip()
318 except Exception:
319 return None
320
321
322def get_git_metadata(cwd: Path | None = None) -> dict[str, str]:

Callers 1

get_git_metadataFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…