Get the SHA-1 of the HEAD of a git repository.
(dir: Path)
| 23 | |
| 24 | |
| 25 | def git_revision(dir: Path) -> str: |
| 26 | """Get the SHA-1 of the HEAD of a git repository.""" |
| 27 | return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], cwd=dir).decode('utf-8').strip() |