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

Function write_basic_state

sequencer.c:3314–3366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3312}
3313
3314int write_basic_state(struct replay_opts *opts, const char *head_name,
3315 struct commit *onto, const struct object_id *orig_head)
3316{
3317 if (head_name)
3318 write_file(rebase_path_head_name(), "%s\n", head_name);
3319 if (onto)
3320 write_file(rebase_path_onto(), "%s\n",
3321 oid_to_hex(&onto->object.oid));
3322 if (orig_head)
3323 write_file(rebase_path_orig_head(), "%s\n",
3324 oid_to_hex(orig_head));
3325
3326 if (opts->quiet)
3327 write_file(rebase_path_quiet(), "%s", "");
3328 if (opts->verbose)
3329 write_file(rebase_path_verbose(), "%s", "");
3330 if (opts->strategy)
3331 write_file(rebase_path_strategy(), "%s\n", opts->strategy);
3332 if (opts->xopts.nr > 0)
3333 write_strategy_opts(opts);
3334
3335 if (opts->allow_rerere_auto == RERERE_AUTOUPDATE)
3336 write_file(rebase_path_allow_rerere_autoupdate(), "--rerere-autoupdate\n");
3337 else if (opts->allow_rerere_auto == RERERE_NOAUTOUPDATE)
3338 write_file(rebase_path_allow_rerere_autoupdate(), "--no-rerere-autoupdate\n");
3339
3340 if (opts->gpg_sign)
3341 write_file(rebase_path_gpg_sign_opt(), "-S%s\n", opts->gpg_sign);
3342 if (opts->signoff)
3343 write_file(rebase_path_signoff(), "--signoff\n");
3344 if (opts->drop_redundant_commits)
3345 write_file(rebase_path_drop_redundant_commits(), "%s", "");
3346 if (opts->keep_redundant_commits)
3347 write_file(rebase_path_keep_redundant_commits(), "%s", "");
3348 if (opts->committer_date_is_author_date)
3349 write_file(rebase_path_cdate_is_adate(), "%s", "");
3350 if (opts->ignore_date)
3351 write_file(rebase_path_ignore_date(), "%s", "");
3352 if (opts->reschedule_failed_exec)
3353 write_file(rebase_path_reschedule_failed_exec(), "%s", "");
3354 else
3355 write_file(rebase_path_no_reschedule_failed_exec(), "%s", "");
3356 if (opts->trailer_args.nr) {
3357 struct strbuf buf = STRBUF_INIT;
3358
3359 for (size_t i = 0; i < opts->trailer_args.nr; i++)
3360 strbuf_addf(&buf, "%s\n", opts->trailer_args.v[i]);
3361 write_file(rebase_path_trailer(), "%s", buf.buf);
3362 strbuf_release(&buf);
3363 }
3364
3365 return 0;
3366}
3367
3368static int walk_revs_populate_todo(struct todo_list *todo_list,
3369 struct replay_opts *opts)

Callers 1

init_basic_stateFunction · 0.85

Calls 5

write_fileFunction · 0.85
oid_to_hexFunction · 0.85
write_strategy_optsFunction · 0.85
strbuf_addfFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected