(repo: Path, *args: str)
| 11 | # Git helpers |
| 12 | # ----------------- |
| 13 | def _git(repo: Path, *args: str) -> str: |
| 14 | proc = subprocess.run( |
| 15 | ["git", *args], |
| 16 | cwd=repo, |
| 17 | capture_output=True, |
| 18 | text=True, |
| 19 | check=False, |
| 20 | ) |
| 21 | if proc.returncode != 0: |
| 22 | raise RuntimeError(f"git {' '.join(args)} failed: {proc.stderr.strip()}") |
| 23 | return proc.stdout.strip() |
| 24 | |
| 25 | |
| 26 | def _init_repo(tmp_path: Path) -> Path: |
no test coverage detected