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

Function find_repo_root

scripts/update_license_headers.py:92–99  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

90
91
92def find_repo_root() -> Path:
93 """Walk up from CWD to find the directory containing .git."""
94 path = Path.cwd()
95 while path != path.parent:
96 if (path / ".git").exists():
97 return path
98 path = path.parent
99 return Path.cwd()
100
101
102def is_excluded(rel: Path) -> bool:

Callers 1

mainFunction · 0.70

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected