MCPcopy Create free account
hub / github.com/git/git / create_seq_dir

Function create_seq_dir

sequencer.c:3409–3446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3407}
3408
3409static int create_seq_dir(struct repository *r)
3410{
3411 enum replay_action action;
3412 const char *in_progress_error = NULL;
3413 const char *in_progress_advice = NULL;
3414 unsigned int advise_skip =
3415 refs_ref_exists(get_main_ref_store(r), "REVERT_HEAD") ||
3416 refs_ref_exists(get_main_ref_store(r), "CHERRY_PICK_HEAD");
3417
3418 if (!sequencer_get_last_command(r, &action)) {
3419 switch (action) {
3420 case REPLAY_REVERT:
3421 in_progress_error = _("revert is already in progress");
3422 in_progress_advice =
3423 _("try \"git revert (--continue | %s--abort | --quit)\"");
3424 break;
3425 case REPLAY_PICK:
3426 in_progress_error = _("cherry-pick is already in progress");
3427 in_progress_advice =
3428 _("try \"git cherry-pick (--continue | %s--abort | --quit)\"");
3429 break;
3430 default:
3431 BUG("unexpected action in create_seq_dir");
3432 }
3433 }
3434 if (in_progress_error) {
3435 error("%s", in_progress_error);
3436 if (advice_enabled(ADVICE_SEQUENCER_IN_USE))
3437 advise(in_progress_advice,
3438 advise_skip ? "--skip | " : "");
3439 return -1;
3440 }
3441 if (mkdir(git_path_seq_dir(), 0777) < 0)
3442 return error_errno(_("could not create sequencer directory '%s'"),
3443 git_path_seq_dir());
3444
3445 return 0;
3446}
3447
3448static int save_head(const char *head)
3449{

Callers 1

sequencer_pick_revisionsFunction · 0.85

Calls 7

refs_ref_existsFunction · 0.85
get_main_ref_storeFunction · 0.85
errorFunction · 0.85
advice_enabledFunction · 0.85
adviseFunction · 0.85
error_errnoFunction · 0.85

Tested by

no test coverage detected