MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / find_repo_root

Function find_repo_root

tools/docs_and_notebooks_check.py:401–412  ·  view source on GitHub ↗
(start: Path)

Source from the content-addressed store, hash-verified

399
400
401def find_repo_root(start: Path) -> Path:
402 cur = start.resolve()
403 for _ in range(50):
404 if (cur / ".git").exists():
405 return cur
406 if cur.parent == cur:
407 break
408 cur = cur.parent
409 code, out, _err = _run_git(["rev-parse", "--show-toplevel"], cwd=start)
410 if code == 0 and out:
411 return Path(out).resolve()
412 raise RuntimeError("Could not locate repository root")
413
414
415def glob_paths(repo_root: Path, patterns: list[str]) -> list[Path]:

Callers 1

mainFunction · 0.70

Calls 1

_run_gitFunction · 0.70

Tested by

no test coverage detected