(repo: Repo, frid: Optional[str])
| 282 | |
| 283 | |
| 284 | def _get_commit(repo: Repo, frid: Optional[str]) -> str: |
| 285 | if frid: |
| 286 | commit_with_frid = _get_commit_with_frid(repo, frid) |
| 287 | if not commit_with_frid: |
| 288 | raise InvalidGitRepositoryError(f"No commit with frid {frid} found.") |
| 289 | return commit_with_frid |
| 290 | |
| 291 | base_folder_commit = _get_base_folder_commit(repo) |
| 292 | initial_commit = _get_initial_commit(repo) |
| 293 | if base_folder_commit and repo.is_ancestor(repo.commit(initial_commit), repo.commit(base_folder_commit)): |
| 294 | return base_folder_commit |
| 295 | return initial_commit |
| 296 | |
| 297 | |
| 298 | def _get_commit_with_frid(repo: Repo, frid: str, module_name: Optional[str] = None) -> str: |
no test coverage detected