Walk up from CWD to find the directory containing .git.
()
| 90 | |
| 91 | |
| 92 | def 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 | |
| 102 | def is_excluded(rel: Path) -> bool: |