(repo_path: Union[str, os.PathLike], frid: str, previous_frid: str)
| 353 | |
| 354 | |
| 355 | def get_implementation_code_diff(repo_path: Union[str, os.PathLike], frid: str, previous_frid: str) -> dict: |
| 356 | repo = Repo(repo_path) |
| 357 | |
| 358 | implementation_commit = _get_commit_with_message(repo, REFACTORED_CODE_COMMIT_MESSAGE.format(frid)) |
| 359 | if not implementation_commit: |
| 360 | implementation_commit = _get_commit_with_message( |
| 361 | repo, FUNCTIONAL_REQUIREMENT_IMPLEMENTED_COMMIT_MESSAGE.format(frid) |
| 362 | ) |
| 363 | |
| 364 | previous_frid_commit = _get_commit(repo, previous_frid) |
| 365 | |
| 366 | # Get the raw git diff output, excluding .pyc files |
| 367 | diff_output = repo.git.diff(previous_frid_commit, implementation_commit, "--text", ":!*.pyc") |
| 368 | |
| 369 | if not diff_output: |
| 370 | return {} |
| 371 | |
| 372 | return _get_diff_dict(diff_output) |
| 373 | |
| 374 | |
| 375 | def get_fixed_implementation_code_diff(repo_path: Union[str, os.PathLike], frid: str) -> dict: |
nothing calls this directly
no test coverage detected