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

Function delayed_reachability_test

shallow.c:875–898  ·  view source on GitHub ↗

(Delayed) step 7, reachability test at commit level */

Source from the content-addressed store, hash-verified

873
874/* (Delayed) step 7, reachability test at commit level */
875int delayed_reachability_test(struct shallow_info *si, int c)
876{
877 if (si->need_reachability_test[c]) {
878 struct commit *commit = lookup_commit(the_repository,
879 &si->shallow->oid[c]);
880
881 if (!si->commits.nr) {
882 refs_head_ref(get_main_ref_store(the_repository),
883 add_ref, &si->commits);
884 refs_for_each_ref(get_main_ref_store(the_repository),
885 add_ref, &si->commits);
886 }
887
888 si->reachable[c] = repo_in_merge_bases_many(the_repository,
889 commit,
890 si->commits.nr,
891 si->commits.items,
892 1);
893 if (si->reachable[c] < 0)
894 exit(128);
895 si->need_reachability_test[c] = 0;
896 }
897 return si->reachable[c];
898}

Callers 1

update_shallow_refFunction · 0.85

Calls 5

lookup_commitFunction · 0.85
refs_head_refFunction · 0.85
get_main_ref_storeFunction · 0.85
refs_for_each_refFunction · 0.85
repo_in_merge_bases_manyFunction · 0.85

Tested by

no test coverage detected