| 1349 | } |
| 1350 | |
| 1351 | static 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 |
no test coverage detected