MCPcopy Create free account
hub / github.com/HKUDS/AutoAgent / get_diff

Function get_diff

autoagent/tools/github_ops.py:22–32  ·  view source on GitHub ↗

f""" Get the diff of the 'autoagent'.

(context_variables)

Source from the content-addressed store, hash-verified

20
21@register_tool("get_diff")
22def get_diff(context_variables):
23 f"""
24 Get the diff of the 'autoagent'.
25 """
26 env: Union[DockerEnv, LocalEnv] = context_variables.get("code_env", LocalEnv())
27 diff_command = f"cd {env.docker_workplace}/autoagent && git add -N . && git diff"
28 result = env.run_command(diff_command)
29 if result['status'] == 0:
30 return result['result'].strip()
31 else:
32 return f"Failed to get the diff. Error: {result['result'].strip()}"
33
34@register_tool("stage_files")
35def stage_files(context_variables, file_paths=None):

Callers 1

github_ops.pyFile · 0.85

Calls 3

LocalEnvClass · 0.90
getMethod · 0.80
run_commandMethod · 0.45

Tested by

no test coverage detected