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

Function find_commits_for_midx_bitmap

midx-write.c:838–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

836}
837
838static void find_commits_for_midx_bitmap(struct commit_stack *commits,
839 const char *refs_snapshot,
840 struct write_midx_context *ctx)
841{
842 struct rev_info revs;
843 struct bitmap_commit_cb cb = { .commits = commits, .ctx = ctx };
844
845 trace2_region_enter("midx", "find_commits_for_midx_bitmap", ctx->repo);
846
847 repo_init_revisions(ctx->repo, &revs, NULL);
848 if (refs_snapshot) {
849 read_refs_snapshot(refs_snapshot, &revs);
850 } else {
851 setup_revisions(0, NULL, &revs, NULL);
852 refs_for_each_ref(get_main_ref_store(ctx->repo),
853 add_ref_to_pending, &revs);
854 }
855
856 /*
857 * Skipping promisor objects here is intentional, since it only excludes
858 * them from the list of reachable commits that we want to select from
859 * when computing the selection of MIDX'd commits to receive bitmaps.
860 *
861 * Reachability bitmaps do require that their objects be closed under
862 * reachability, but fetching any objects missing from promisors at this
863 * point is too late. But, if one of those objects can be reached from
864 * an another object that is included in the bitmap, then we will
865 * complain later that we don't have reachability closure (and fail
866 * appropriately).
867 */
868 fetch_if_missing = 0;
869 revs.exclude_promisor_objects = 1;
870
871 if (prepare_revision_walk(&revs))
872 die(_("revision walk setup failed"));
873
874 traverse_commit_list(&revs, bitmap_show_commit, NULL, &cb);
875
876 release_revisions(&revs);
877
878 trace2_region_leave("midx", "find_commits_for_midx_bitmap", ctx->repo);
879}
880
881static int write_midx_bitmap(struct write_midx_context *ctx,
882 const unsigned char *midx_hash,

Callers 1

write_midx_internalFunction · 0.85

Calls 9

repo_init_revisionsFunction · 0.85
read_refs_snapshotFunction · 0.85
setup_revisionsFunction · 0.85
refs_for_each_refFunction · 0.85
get_main_ref_storeFunction · 0.85
prepare_revision_walkFunction · 0.85
traverse_commit_listFunction · 0.85
release_revisionsFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected