(target: Path, revision: str, label: str)
| 782 | |
| 783 | |
| 784 | def resolve_git_commit(target: Path, revision: str, label: str) -> str: |
| 785 | value = optional_text(revision, maximum=512) |
| 786 | if not value: |
| 787 | raise SystemExit(f"{label} is required.") |
| 788 | resolved = git_output( |
| 789 | target, |
| 790 | "rev-parse", |
| 791 | "--verify", |
| 792 | "--end-of-options", |
| 793 | f"{value}^{{commit}}", |
| 794 | ) |
| 795 | if resolved is None: |
| 796 | raise SystemExit(f"{label} does not resolve to a local Git commit: {value}") |
| 797 | return resolved |
| 798 | |
| 799 | |
| 800 | def require_diff_target( |
no test coverage detected