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

Function checkout_onto

sequencer.c:4866–4886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4864}
4865
4866static int checkout_onto(struct repository *r, struct replay_opts *opts,
4867 const char *onto_name, const struct object_id *onto,
4868 const struct object_id *orig_head)
4869{
4870 struct reset_head_opts ropts = {
4871 .oid = onto,
4872 .orig_head = orig_head,
4873 .flags = RESET_HEAD_DETACH | RESET_ORIG_HEAD |
4874 RESET_HEAD_RUN_POST_CHECKOUT_HOOK,
4875 .head_msg = reflog_message(opts, "start", "checkout %s",
4876 onto_name),
4877 .default_reflog_action = sequencer_reflog_action(opts)
4878 };
4879 if (reset_head(r, &ropts)) {
4880 apply_autostash(rebase_path_autostash());
4881 sequencer_remove_state(opts);
4882 return error(_("could not detach HEAD"));
4883 }
4884
4885 return 0;
4886}
4887
4888static int stopped_at_head(struct repository *r)
4889{

Callers 1

complete_actionFunction · 0.85

Calls 6

reflog_messageFunction · 0.85
sequencer_reflog_actionFunction · 0.85
apply_autostashFunction · 0.85
sequencer_remove_stateFunction · 0.85
errorFunction · 0.85
reset_headFunction · 0.70

Tested by

no test coverage detected