f""" Get the current branch of the 'autoagent'.
(context_variables)
| 7 | from typing import Union |
| 8 | @register_tool("get_current_branch") |
| 9 | def get_current_branch(context_variables): |
| 10 | f""" |
| 11 | Get the current branch of the 'autoagent'. |
| 12 | """ |
| 13 | env: Union[DockerEnv, LocalEnv] = context_variables.get("code_env", LocalEnv()) |
| 14 | branch_command = f"cd {env.docker_workplace}/autoagent && git branch --show-current" |
| 15 | result = env.run_command(branch_command) |
| 16 | if result['status'] == 0: |
| 17 | return result['result'].strip() |
| 18 | else: |
| 19 | return f"Failed to get the current branch. Error: {result['result'].strip()}" |
| 20 | |
| 21 | @register_tool("get_diff") |
| 22 | def get_diff(context_variables): |
no test coverage detected