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

Function find_boundary_objects

pack-bitmap.c:1351–1468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1349}
1350
1351static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
1352 struct rev_info *revs,
1353 struct object_list *roots)
1354{
1355 struct bitmap_boundary_cb cb;
1356 struct object_list *root;
1357 struct repository *repo;
1358 unsigned int i;
1359 unsigned int tmp_blobs, tmp_trees, tmp_tags;
1360 int any_missing = 0;
1361 int existing_bitmaps = 0;
1362
1363 cb.bitmap_git = bitmap_git;
1364 cb.base = bitmap_new();
1365 object_array_init(&cb.boundary);
1366
1367 repo = bitmap_repo(bitmap_git);
1368
1369 revs->ignore_missing_links = 1;
1370
1371 if (bitmap_git->pseudo_merges.nr) {
1372 struct bitmap *roots_bitmap = bitmap_new();
1373 struct object_list *objects = NULL;
1374
1375 for (objects = roots; objects; objects = objects->next) {
1376 struct object *object = objects->item;
1377 int pos;
1378
1379 pos = bitmap_position(bitmap_git, &object->oid);
1380 if (pos < 0)
1381 continue;
1382
1383 bitmap_set(roots_bitmap, pos);
1384 }
1385
1386 cascade_pseudo_merges_1(bitmap_git, cb.base, roots_bitmap);
1387 bitmap_free(roots_bitmap);
1388 }
1389
1390 /*
1391 * OR in any existing reachability bitmaps among `roots` into
1392 * `cb.base`.
1393 */
1394 for (root = roots; root; root = root->next) {
1395 struct object *object = root->item;
1396 if (object->type != OBJ_COMMIT ||
1397 bitmap_walk_contains(bitmap_git, cb.base, &object->oid))
1398 continue;
1399
1400 if (add_commit_to_bitmap(bitmap_git, &cb.base,
1401 (struct commit *)object)) {
1402 existing_bitmaps = 1;
1403 continue;
1404 }
1405
1406 any_missing = 1;
1407 }
1408

Callers 1

prepare_bitmap_walkFunction · 0.85

Calls 15

bitmap_newFunction · 0.85
object_array_initFunction · 0.85
bitmap_repoFunction · 0.85
bitmap_positionFunction · 0.85
bitmap_setFunction · 0.85
cascade_pseudo_merges_1Function · 0.85
bitmap_freeFunction · 0.85
bitmap_walk_containsFunction · 0.85
add_commit_to_bitmapFunction · 0.85
prepare_revision_walkFunction · 0.85
reset_revision_walkFunction · 0.85

Tested by

no test coverage detected