(args: Sequence[str], cwd: Path)
| 151 | # Git helpers |
| 152 | # ----------------------------- |
| 153 | def _run_git(args: Sequence[str], cwd: Path) -> str: |
| 154 | proc = subprocess.run( |
| 155 | ["git", *args], |
| 156 | cwd=str(cwd), |
| 157 | capture_output=True, |
| 158 | text=True, |
| 159 | check=False, |
| 160 | ) |
| 161 | if proc.returncode != 0: |
| 162 | raise RuntimeError(f"git {' '.join(args)} failed: {proc.stderr.strip()}") |
| 163 | return proc.stdout.strip() |
| 164 | |
| 165 | |
| 166 | def find_repo_root() -> Path: |
no test coverage detected