| 4864 | } |
| 4865 | |
| 4866 | static 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 | |
| 4888 | static int stopped_at_head(struct repository *r) |
| 4889 | { |
no test coverage detected