Skip to content

Commit 2264265

Browse files
author
yolo h8cker 93
committed
Minor speed up reset_and_apply_patch
1 parent 2ca92c2 commit 2264265

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

codeclash/agents/player.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,10 @@ def reset_and_apply_patch(self, patch: str, *, base_commit: str = "", filter_pat
135135
dest_path="tmp_patch.txt",
136136
)
137137

138-
self.logger.debug(f"Applying patch to agent's codebase: {patch}")
139-
140138
commands = ["git status", "git apply tmp_patch.txt", "rm -f tmp_patch.txt"]
141-
for cmd in commands:
142-
self.logger.debug(f"Executing command: {cmd}")
143-
out = assert_zero_exit_code(self.environment.execute(cmd), logger=self.logger)
144-
self.logger.debug(out)
139+
cmd = " && ".join(commands)
140+
self.logger.debug(f"Executing command: {cmd}")
141+
assert_zero_exit_code(self.environment.execute(cmd), logger=self.logger)
145142

146143
# --- Helper methods ---
147144

0 commit comments

Comments
 (0)