MCPcopy Index your code
hub / github.com/git/git / sequencer_post_commit_cleanup

Function sequencer_post_commit_cleanup

sequencer.c:2965–3000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2963}
2964
2965void sequencer_post_commit_cleanup(struct repository *r, int verbose)
2966{
2967 struct replay_opts opts = REPLAY_OPTS_INIT;
2968 int need_cleanup = 0;
2969
2970 if (refs_ref_exists(get_main_ref_store(r), "CHERRY_PICK_HEAD")) {
2971 if (!refs_delete_ref(get_main_ref_store(r), "",
2972 "CHERRY_PICK_HEAD", NULL, REF_NO_DEREF) &&
2973 verbose)
2974 warning(_("cancelling a cherry picking in progress"));
2975 opts.action = REPLAY_PICK;
2976 need_cleanup = 1;
2977 }
2978
2979 if (refs_ref_exists(get_main_ref_store(r), "REVERT_HEAD")) {
2980 if (!refs_delete_ref(get_main_ref_store(r), "", "REVERT_HEAD",
2981 NULL, REF_NO_DEREF) &&
2982 verbose)
2983 warning(_("cancelling a revert in progress"));
2984 opts.action = REPLAY_REVERT;
2985 need_cleanup = 1;
2986 }
2987
2988 refs_delete_ref(get_main_ref_store(r), "", "AUTO_MERGE",
2989 NULL, REF_NO_DEREF);
2990
2991 if (!need_cleanup)
2992 goto out;
2993
2994 if (!have_finished_the_last_pick())
2995 goto out;
2996
2997 sequencer_remove_state(&opts);
2998out:
2999 replay_opts_release(&opts);
3000}
3001
3002static void todo_list_write_total_nr(struct todo_list *todo_list)
3003{

Callers 2

remove_branch_stateFunction · 0.85
cmd_commitFunction · 0.85

Calls 7

refs_ref_existsFunction · 0.85
get_main_ref_storeFunction · 0.85
refs_delete_refFunction · 0.85
warningFunction · 0.85
sequencer_remove_stateFunction · 0.85
replay_opts_releaseFunction · 0.85

Tested by

no test coverage detected