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

Function get_implementation_code_diff

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

Source from the content-addressed store, hash-verified

353
354
355def 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
375def get_fixed_implementation_code_diff(repo_path: Union[str, os.PathLike], frid: str) -> dict:

Callers

nothing calls this directly

Calls 4

_get_commit_with_messageFunction · 0.85
_get_commitFunction · 0.85
_get_diff_dictFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected