MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / clone_repo

Function clone_repo

benchmarks/run_benchmarks.py:60–75  ·  view source on GitHub ↗
(name: str, url: str, skip_clone: bool)

Source from the content-addressed store, hash-verified

58
59
60def clone_repo(name: str, url: str, skip_clone: bool) -> Path:
61 dest = CLONE_DIR / name
62 if dest.exists():
63 log(f"{name}: reusing existing clone at {dest}")
64 return dest
65 if skip_clone:
66 raise FileNotFoundError(f"{name}: --skip-clone requested but {dest} does not exist")
67 CLONE_DIR.mkdir(parents=True, exist_ok=True)
68 log(f"{name}: cloning {url} (shallow, depth=1) ...")
69 subprocess.run(
70 ["git", "clone", "--depth=1", "--single-branch", url, str(dest)],
71 check=True,
72 capture_output=True,
73 text=True,
74 )
75 return dest
76
77
78def naive_source_size(root: str) -> int:

Callers 1

mainFunction · 0.85

Calls 3

existsMethod · 0.80
logFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected