Run a git command and return the completed process (no raise).
(args: list[str], cwd: Path | None)
| 53 | |
| 54 | |
| 55 | def run_git(args: list[str], cwd: Path | None) -> subprocess.CompletedProcess[str]: |
| 56 | """Run a git command and return the completed process (no raise).""" |
| 57 | return subprocess.run( |
| 58 | ["git", *args], |
| 59 | cwd=str(cwd) if cwd else None, |
| 60 | capture_output=True, |
| 61 | text=True, |
| 62 | encoding="utf-8", |
| 63 | errors="replace", |
| 64 | check=False, |
| 65 | ) |
| 66 | |
| 67 | |
| 68 | def directory_size_bytes(path: Path) -> int: |
no test coverage detected