MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / find_repo_root

Function find_repo_root

scripts/generate_third_party_notices.py:52–59  ·  view source on GitHub ↗

Walk up from CWD to find the directory containing .git.

()

Source from the content-addressed store, hash-verified

50
51
52def find_repo_root() -> Path:
53 """Walk up from CWD to find the directory containing .git."""
54 path = Path.cwd()
55 while path != path.parent:
56 if (path / ".git").exists():
57 return path
58 path = path.parent
59 return Path.cwd()
60
61
62# ---------------------------------------------------------------------------

Callers 1

mainFunction · 0.70

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected