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

Function sequencer_remove_state

sequencer.c:429–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427}
428
429int sequencer_remove_state(struct replay_opts *opts)
430{
431 struct strbuf buf = STRBUF_INIT;
432 int ret = 0;
433
434 if (is_rebase_i(opts) &&
435 strbuf_read_file(&buf, rebase_path_refs_to_delete(), 0) > 0) {
436 char *p = buf.buf;
437 while (*p) {
438 char *eol = strchr(p, '\n');
439 if (eol)
440 *eol = '\0';
441 if (refs_delete_ref(get_main_ref_store(the_repository), "(rebase) cleanup", p, NULL, 0) < 0) {
442 warning(_("could not delete '%s'"), p);
443 ret = -1;
444 }
445 if (!eol)
446 break;
447 p = eol + 1;
448 }
449 }
450
451 strbuf_reset(&buf);
452 strbuf_addstr(&buf, get_dir(opts));
453 if (remove_dir_recursively(&buf, 0))
454 ret = error(_("could not remove '%s'"), buf.buf);
455 strbuf_release(&buf);
456
457 return ret;
458}
459
460static const char *action_name(const struct replay_opts *opts)
461{

Callers 8

sequencer_rollbackFunction · 0.85
checkout_ontoFunction · 0.85
pick_commitsFunction · 0.85
complete_actionFunction · 0.85
finish_rebaseFunction · 0.85
cmd_rebaseFunction · 0.85
run_sequencerFunction · 0.85

Calls 10

is_rebase_iFunction · 0.85
strbuf_read_fileFunction · 0.85
refs_delete_refFunction · 0.85
get_main_ref_storeFunction · 0.85
warningFunction · 0.85
strbuf_addstrFunction · 0.85
get_dirFunction · 0.85
remove_dir_recursivelyFunction · 0.85
errorFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected