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

Function pull_into_void

builtin/pull.c:464–494  ·  view source on GitHub ↗

* "Pulls into void" by branching off merge_head. */

Source from the content-addressed store, hash-verified

462 * "Pulls into void" by branching off merge_head.
463 */
464static 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
496static int rebase_submodules(void)
497{

Callers 1

cmd_pullFunction · 0.85

Calls 7

lookup_commitFunction · 0.85
oid_to_hexFunction · 0.85
verify_merge_signatureFunction · 0.85
checkout_fast_forwardFunction · 0.85
refs_update_refFunction · 0.85
get_main_ref_storeFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected