MCPcopy Index your code
hub / github.com/Codeplain-ai/codeplain / get_fixed_implementation_code_diff

Function get_fixed_implementation_code_diff

git_utils.py:375–396  ·  view source on GitHub ↗
(repo_path: Union[str, os.PathLike], frid: str)

Source from the content-addressed store, hash-verified

373
374
375def 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
399def get_repo_info(repo_path: Union[str, os.PathLike]) -> dict:

Callers

nothing calls this directly

Calls 3

_get_commit_with_messageFunction · 0.85
_get_diff_dictFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected