MCPcopy Index your code
hub / github.com/git/git / prepare_bitmap_walk

Function prepare_bitmap_walk

pack-bitmap.c:2103–2257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2101}
2102
2103struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
2104 int filter_provided_objects)
2105{
2106 unsigned int i;
2107 int use_boundary_traversal;
2108
2109 struct object_list *wants = NULL;
2110 struct object_list *haves = NULL;
2111
2112 struct bitmap *wants_bitmap = NULL;
2113 struct bitmap *haves_bitmap = NULL;
2114
2115 struct bitmap_index *bitmap_git;
2116 struct repository *repo;
2117
2118 /*
2119 * We can't do pathspec limiting with bitmaps, because we don't know
2120 * which commits are associated with which object changes (let alone
2121 * even which objects are associated with which paths).
2122 */
2123 if (revs->prune)
2124 return NULL;
2125
2126 if (!can_filter_bitmap(&revs->filter))
2127 return NULL;
2128
2129 /* try to open a bitmapped pack, but don't parse it yet
2130 * because we may not need to use it */
2131 CALLOC_ARRAY(bitmap_git, 1);
2132 if (open_bitmap(revs->repo, bitmap_git) < 0)
2133 goto cleanup;
2134
2135 for (i = 0; i < revs->pending.nr; ++i) {
2136 struct object *object = revs->pending.objects[i].item;
2137
2138 if (object->type == OBJ_NONE)
2139 parse_object_or_die(revs->repo, &object->oid, NULL);
2140
2141 while (object->type == OBJ_TAG) {
2142 struct tag *tag = (struct tag *) object;
2143
2144 if (object->flags & UNINTERESTING)
2145 object_list_insert(object, &haves);
2146 else
2147 object_list_insert(object, &wants);
2148
2149 object = parse_object_or_die(revs->repo, get_tagged_oid(tag), NULL);
2150 object->flags |= (tag->object.flags & UNINTERESTING);
2151 }
2152
2153 if (object->flags & UNINTERESTING)
2154 object_list_insert(object, &haves);
2155 else
2156 object_list_insert(object, &wants);
2157 }
2158
2159 use_boundary_traversal = git_env_bool(GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL, -1);
2160 if (use_boundary_traversal < 0) {

Callers 5

mark_reachable_objectsFunction · 0.85
try_bitmap_countFunction · 0.85
try_bitmap_traversalFunction · 0.85
try_bitmap_disk_usageFunction · 0.85

Calls 15

can_filter_bitmapFunction · 0.85
open_bitmapFunction · 0.85
parse_object_or_dieFunction · 0.85
object_list_insertFunction · 0.85
get_tagged_oidFunction · 0.85
git_env_boolFunction · 0.85
prepare_repo_settingsFunction · 0.85
in_bitmapped_packFunction · 0.85
load_bitmapFunction · 0.85
object_array_clearFunction · 0.85
bitmap_repoFunction · 0.85
find_boundary_objectsFunction · 0.85

Tested by

no test coverage detected