@@ -61,14 +61,6 @@ def run_agent_for_repo(
61
61
repo_path = os .path .join (repo_base_dir , repo_name )
62
62
repo_path = os .path .abspath (repo_path )
63
63
64
- # get target files to edit and test files to run
65
- target_edit_files = get_target_edit_files (
66
- repo_path , example ["src_dir" ], example ["test" ]["test_dir" ]
67
- )
68
- # Call the commit0 get-tests command to retrieve test files
69
- test_files_str = get_tests (repo_name , verbose = 0 )
70
- test_files = sorted (list (set ([i .split (":" )[0 ] for i in test_files_str ])))
71
-
72
64
try :
73
65
local_repo = Repo (repo_path )
74
66
except Exception :
@@ -95,6 +87,19 @@ def run_agent_for_repo(
95
87
if latest_commit .hexsha != example ["base_commit" ] and override_previous_changes :
96
88
local_repo .git .reset ("--hard" , example ["base_commit" ])
97
89
90
+ # get target files to edit and test files to run
91
+ target_edit_files = get_target_edit_files (
92
+ local_repo ,
93
+ example ["src_dir" ],
94
+ example ["test" ]["test_dir" ],
95
+ str (latest_commit ),
96
+ str (example ["reference_commit" ]),
97
+ )
98
+
99
+ # Call the commit0 get-tests command to retrieve test files
100
+ test_files_str = get_tests (repo_name , verbose = 0 )
101
+ test_files = sorted (list (set ([i .split (":" )[0 ] for i in test_files_str ])))
102
+
98
103
# prepare the log dir
99
104
experiment_log_dir = (
100
105
Path (log_dir )
0 commit comments