* "Pulls into void" by branching off merge_head. */
| 462 | * "Pulls into void" by branching off merge_head. |
| 463 | */ |
| 464 | static int pull_into_void(const struct object_id *merge_head, |
| 465 | const struct object_id *curr_head) |
| 466 | { |
| 467 | if (opt_verify_signatures) { |
| 468 | struct commit *commit; |
| 469 | |
| 470 | commit = lookup_commit(the_repository, merge_head); |
| 471 | if (!commit) |
| 472 | die(_("unable to access commit %s"), |
| 473 | oid_to_hex(merge_head)); |
| 474 | |
| 475 | verify_merge_signature(commit, opt_verbosity, |
| 476 | check_trust_level); |
| 477 | } |
| 478 | |
| 479 | /* |
| 480 | * Two-way merge: we treat the index as based on an empty tree, |
| 481 | * and try to fast-forward to HEAD. This ensures we will not lose |
| 482 | * index/worktree changes that the user already made on the unborn |
| 483 | * branch. |
| 484 | */ |
| 485 | if (checkout_fast_forward(the_repository, |
| 486 | the_hash_algo->empty_tree, |
| 487 | merge_head, 0)) |
| 488 | return 1; |
| 489 | |
| 490 | if (refs_update_ref(get_main_ref_store(the_repository), "initial pull", "HEAD", merge_head, curr_head, 0, UPDATE_REFS_DIE_ON_ERR)) |
| 491 | return 1; |
| 492 | |
| 493 | return 0; |
| 494 | } |
| 495 | |
| 496 | static int rebase_submodules(void) |
| 497 | { |
no test coverage detected