MCPcopy Index your code
hub / github.com/FSoft-AI4Code/HyperAgent / extract_patch

Function extract_patch

src/hyperagent/utils.py:510–518  ·  view source on GitHub ↗
(
    repo_dir: str
)

Source from the content-addressed store, hash-verified

508 print(text_to_print, end=end, file=file)
509
510def extract_patch(
511 repo_dir: str
512) -> str:
513 random_name = generate_random_string(8)
514 os.system(f"cd {repo_dir} && git diff HEAD > {DEFAULT_PATCHES_DIR}/{random_name}.diff")
515
516 with open(f"{DEFAULT_PATCHES_DIR}/{random_name}.diff", "r") as f:
517 patch = f.read()
518 return patch
519
520def find_matching_abs_path(parent_folder, sub_path):
521 # Walk through the parent folder to find matching sub-path

Callers 3

runMethod · 0.90
runMethod · 0.90
response_preparerFunction · 0.90

Calls 1

generate_random_stringFunction · 0.85

Tested by

no test coverage detected