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

Function pick_commits

sequencer.c:5000–5230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4998}
4999
5000static int pick_commits(struct repository *r,
5001 struct todo_list *todo_list,
5002 struct replay_opts *opts)
5003{
5004 struct replay_ctx *ctx = opts->ctx;
5005 int res = 0, reschedule = 0;
5006
5007 if (opts->allow_ff)
5008 ASSERT(!(opts->signoff || opts->no_commit ||
5009 opts->record_origin || should_edit(opts) ||
5010 opts->committer_date_is_author_date ||
5011 opts->ignore_date));
5012 if (read_and_refresh_cache(r, opts))
5013 return -1;
5014
5015 unlink(rebase_path_message());
5016 unlink(rebase_path_stopped_sha());
5017 unlink(rebase_path_amend());
5018 unlink(rebase_path_patch());
5019
5020 while (todo_list->current < todo_list->nr) {
5021 struct todo_item *item = todo_list->items + todo_list->current;
5022 const char *arg = todo_item_get_arg(todo_list, item);
5023 int check_todo = 0;
5024
5025 if (save_todo(todo_list, opts, reschedule))
5026 return -1;
5027 if (is_rebase_i(opts)) {
5028 if (item->command != TODO_COMMENT) {
5029 FILE *f = fopen(rebase_path_msgnum(), "w");
5030
5031 todo_list->done_nr++;
5032
5033 if (f) {
5034 fprintf(f, "%d\n", todo_list->done_nr);
5035 fclose(f);
5036 }
5037 if (!opts->quiet)
5038 fprintf(stderr, _("Rebasing (%d/%d)%s"),
5039 todo_list->done_nr,
5040 todo_list->total_nr,
5041 opts->verbose ? "\n" : "\r");
5042 }
5043 unlink(rebase_path_author_script());
5044 unlink(git_path_merge_head(r));
5045 refs_delete_ref(get_main_ref_store(r), "", "AUTO_MERGE",
5046 NULL, REF_NO_DEREF);
5047 refs_delete_ref(get_main_ref_store(r), "", "REBASE_HEAD",
5048 NULL, REF_NO_DEREF);
5049
5050 if (item->command == TODO_BREAK) {
5051 if (!opts->verbose)
5052 term_clear_line();
5053 return stopped_at_head(r);
5054 }
5055 }
5056 strbuf_reset(&ctx->message);
5057 ctx->have_message = 0;

Callers 3

sequencer_continueFunction · 0.85
sequencer_pick_revisionsFunction · 0.85
complete_actionFunction · 0.85

Calls 15

should_editFunction · 0.85
read_and_refresh_cacheFunction · 0.85
todo_item_get_argFunction · 0.85
save_todoFunction · 0.85
is_rebase_iFunction · 0.85
refs_delete_refFunction · 0.85
get_main_ref_storeFunction · 0.85
term_clear_lineFunction · 0.85
stopped_at_headFunction · 0.85
pick_one_commitFunction · 0.85
do_execFunction · 0.85
do_labelFunction · 0.85

Tested by

no test coverage detected