MCPcopy Create free account
hub / github.com/git/git / bisect_clean_state

Function bisect_clean_state

bisect.c:1191–1221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1189}
1190
1191int 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}

Callers 2

bisect_resetFunction · 0.85
bisect_startFunction · 0.85

Calls 6

refs_for_each_ref_extFunction · 0.85
get_main_ref_storeFunction · 0.85
refs_delete_refsFunction · 0.85
string_list_clearFunction · 0.85
unlink_or_warnFunction · 0.85
string_list_appendFunction · 0.70

Tested by

no test coverage detected