| 2963 | } |
| 2964 | |
| 2965 | void 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); |
| 2998 | out: |
| 2999 | replay_opts_release(&opts); |
| 3000 | } |
| 3001 | |
| 3002 | static void todo_list_write_total_nr(struct todo_list *todo_list) |
| 3003 | { |
no test coverage detected