(args: list[str], *, check: bool = True)
| 70 | |
| 71 | |
| 72 | def run_git(args: list[str], *, check: bool = True) -> str: |
| 73 | result = subprocess.run( |
| 74 | ["git", *args], |
| 75 | check=False, |
| 76 | text=True, |
| 77 | stdout=subprocess.PIPE, |
| 78 | stderr=subprocess.PIPE, |
| 79 | ) |
| 80 | if check and result.returncode != 0: |
| 81 | raise RuntimeError(result.stderr.strip() or f"git {' '.join(args)} failed") |
| 82 | return result.stdout |
| 83 | |
| 84 | |
| 85 | def repo_root() -> Path: |
no outgoing calls
no test coverage detected