@@ -61,14 +61,6 @@ def run_agent_for_repo(
6161 repo_path = os .path .join (repo_base_dir , repo_name )
6262 repo_path = os .path .abspath (repo_path )
6363
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-
7264 try :
7365 local_repo = Repo (repo_path )
7466 except Exception :
@@ -95,6 +87,19 @@ def run_agent_for_repo(
9587 if latest_commit .hexsha != example ["base_commit" ] and override_previous_changes :
9688 local_repo .git .reset ("--hard" , example ["base_commit" ])
9789
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+
98103 # prepare the log dir
99104 experiment_log_dir = (
100105 Path (log_dir )
0 commit comments