Skip to content

Commit 2ab0665

Browse files
committed
Fix(player): Pull codebase before checking out
1 parent 3874a55 commit 2ab0665

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

codeclash/agents/player.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ def __init__(
4747
"agent_stats": {}, # mapping round -> agent stats
4848
}
4949

50-
if "branch_init" in config:
51-
self.logger.info(f"Initializing codebase from branch {config['branch_init']}")
52-
assert_zero_exit_code(self.environment.execute(f"git checkout {config['branch_init']}"), logger=self.logger)
50+
self.logger.info(f"Pulling latest changes from origin for {self.name}")
51+
assert_zero_exit_code(self.environment.execute("git pull origin"), logger=self.logger)
52+
if branch := config.get("branch_init"):
53+
self.logger.info(f"Checkout out branch {branch}")
54+
assert_zero_exit_code(self.environment.execute(f"git checkout {branch}"), logger=self.logger)
5355

5456
if self.push:
5557
self.logger.info("Will push agent gameplay as branch to remote repository after each round")

0 commit comments

Comments
 (0)