Check if folder is a git repository and ref is a git reference.
(ref: str, wd: Optional[Union[str, Path]] = None)
| 310 | |
| 311 | |
| 312 | def check_git_ref(ref: str, wd: Optional[Union[str, Path]] = None) -> None: |
| 313 | """Check if folder is a git repository and ref is a git reference.""" |
| 314 | if wd is None: |
| 315 | wd = Path.cwd() |
| 316 | check_git_dir(wd) |
| 317 | |
| 318 | if not is_valid_git_commit_ref(ref=ref, wd=wd): |
| 319 | raise InvalidGitRefError(ref) |
| 320 | |
| 321 | |
| 322 | def get_list_commit_SHA( |