Read a blob from git, normalised to LF.
(ref: str)
| 576 | |
| 577 | |
| 578 | def _git_show(ref: str) -> str: |
| 579 | """Read a blob from git, normalised to LF.""" |
| 580 | result = subprocess.run( |
| 581 | ["git", "show", ref], |
| 582 | cwd=REPO_ROOT, |
| 583 | capture_output=True, |
| 584 | text=True, |
| 585 | encoding="utf-8", |
| 586 | ) |
| 587 | if result.returncode != 0: |
| 588 | raise SystemExit(f"error: could not read {ref}: {result.stderr.strip()}") |
| 589 | return result.stdout |
| 590 | |
| 591 | |
| 592 | def _v8_available() -> bool: |
no test coverage detected