MCPcopy
hub / github.com/opentrace/opentrace / _run

Function _run

agent/src/opentrace_agent/cli/main.py:1931–1945  ·  view source on GitHub ↗
(args: list[str])

Source from the content-addressed store, hash-verified

1929 from opentrace_agent.sources.code.git_cloner import _clean_env
1930
1931 def _run(args: list[str]) -> tuple[int, str]:
1932 try:
1933 proc = subprocess.run(
1934 ["git", "-C", str(clone_dir), *args],
1935 capture_output=True,
1936 text=True,
1937 timeout=60,
1938 env=_clean_env(),
1939 )
1940 except subprocess.TimeoutExpired:
1941 return 124, "git command timed out after 60s"
1942 except Exception as e:
1943 return 1, _scrub_token(str(e))
1944 msg = (proc.stderr or proc.stdout or "").strip()
1945 return proc.returncode, _scrub_token(msg)
1946
1947 if ref:
1948 rc, msg = _run(["fetch", "--depth=1", "origin", ref])

Callers 1

_update_existing_cloneFunction · 0.70

Calls 3

_clean_envFunction · 0.90
_scrub_tokenFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected