(repo_path: Union[str, os.PathLike], frid: str)
| 373 | |
| 374 | |
| 375 | def get_fixed_implementation_code_diff(repo_path: Union[str, os.PathLike], frid: str) -> dict: |
| 376 | repo = Repo(repo_path) |
| 377 | |
| 378 | implementation_commit = _get_commit_with_message(repo, REFACTORED_CODE_COMMIT_MESSAGE.format(frid)) |
| 379 | if not implementation_commit: |
| 380 | implementation_commit = _get_commit_with_message( |
| 381 | repo, FUNCTIONAL_REQUIREMENT_IMPLEMENTED_COMMIT_MESSAGE.format(frid) |
| 382 | ) |
| 383 | |
| 384 | conformance_tests_passed_commit = _get_commit_with_message( |
| 385 | repo, CONFORMANCE_TESTS_PASSED_COMMIT_MESSAGE.format(frid) |
| 386 | ) |
| 387 | if not conformance_tests_passed_commit: |
| 388 | return None |
| 389 | |
| 390 | # Get the raw git diff output, excluding .pyc files |
| 391 | diff_output = repo.git.diff(implementation_commit, conformance_tests_passed_commit, "--text", ":!*.pyc") |
| 392 | |
| 393 | if not diff_output: |
| 394 | return {} |
| 395 | |
| 396 | return _get_diff_dict(diff_output) |
| 397 | |
| 398 | |
| 399 | def get_repo_info(repo_path: Union[str, os.PathLike]) -> dict: |
nothing calls this directly
no test coverage detected