| 1189 | } |
| 1190 | |
| 1191 | int bisect_clean_state(void) |
| 1192 | { |
| 1193 | struct refs_for_each_ref_options opts = { |
| 1194 | .prefix = "refs/bisect/", |
| 1195 | }; |
| 1196 | int result = 0; |
| 1197 | |
| 1198 | /* There may be some refs packed during bisection */ |
| 1199 | struct string_list refs_for_removal = STRING_LIST_INIT_DUP; |
| 1200 | refs_for_each_ref_ext(get_main_ref_store(the_repository), |
| 1201 | mark_for_removal, &refs_for_removal, &opts); |
| 1202 | string_list_append(&refs_for_removal, "BISECT_HEAD"); |
| 1203 | string_list_append(&refs_for_removal, "BISECT_EXPECTED_REV"); |
| 1204 | result = refs_delete_refs(get_main_ref_store(the_repository), |
| 1205 | "bisect: remove", &refs_for_removal, |
| 1206 | REF_NO_DEREF); |
| 1207 | string_list_clear(&refs_for_removal, 0); |
| 1208 | unlink_or_warn(git_path_bisect_ancestors_ok()); |
| 1209 | unlink_or_warn(git_path_bisect_log()); |
| 1210 | unlink_or_warn(git_path_bisect_names()); |
| 1211 | unlink_or_warn(git_path_bisect_run()); |
| 1212 | unlink_or_warn(git_path_bisect_terms()); |
| 1213 | unlink_or_warn(git_path_bisect_first_parent()); |
| 1214 | /* |
| 1215 | * Cleanup BISECT_START last to support the --no-checkout option |
| 1216 | * introduced in the commit 4796e823a. |
| 1217 | */ |
| 1218 | unlink_or_warn(git_path_bisect_start()); |
| 1219 | |
| 1220 | return result; |
| 1221 | } |
no test coverage detected