| 297 | } |
| 298 | |
| 299 | void mark_reachable_objects(struct rev_info *revs, int mark_reflog, |
| 300 | timestamp_t mark_recent, struct progress *progress) |
| 301 | { |
| 302 | struct connectivity_progress cp; |
| 303 | struct bitmap_index *bitmap_git; |
| 304 | |
| 305 | /* |
| 306 | * Set up revision parsing, and mark us as being interested |
| 307 | * in all object types, not just commits. |
| 308 | */ |
| 309 | revs->tag_objects = 1; |
| 310 | revs->blob_objects = 1; |
| 311 | revs->tree_objects = 1; |
| 312 | |
| 313 | /* Add all refs from the index file */ |
| 314 | add_index_objects_to_pending(revs, 0); |
| 315 | |
| 316 | /* Add all external refs */ |
| 317 | refs_for_each_ref(get_main_ref_store(the_repository), add_one_ref, |
| 318 | revs); |
| 319 | |
| 320 | /* detached HEAD is not included in the list above */ |
| 321 | refs_head_ref(get_main_ref_store(the_repository), add_one_ref, revs); |
| 322 | other_head_refs(add_one_ref, revs); |
| 323 | |
| 324 | /* rebase autostash and orig-head */ |
| 325 | add_rebase_files(revs); |
| 326 | |
| 327 | /* Add all reflog info */ |
| 328 | if (mark_reflog) |
| 329 | add_reflogs_to_pending(revs, 0); |
| 330 | |
| 331 | cp.progress = progress; |
| 332 | cp.count = 0; |
| 333 | |
| 334 | bitmap_git = prepare_bitmap_walk(revs, 0); |
| 335 | if (bitmap_git) { |
| 336 | traverse_bitmap_commit_list(bitmap_git, revs, mark_object_seen); |
| 337 | free_bitmap_index(bitmap_git); |
| 338 | } else { |
| 339 | if (prepare_revision_walk(revs)) |
| 340 | die("revision walk setup failed"); |
| 341 | traverse_commit_list(revs, mark_commit, mark_object, &cp); |
| 342 | } |
| 343 | |
| 344 | if (mark_recent) { |
| 345 | revs->ignore_missing_links = 1; |
| 346 | if (add_unseen_recent_objects_to_traversal(revs, mark_recent, |
| 347 | NULL, 0)) |
| 348 | die("unable to mark recent objects"); |
| 349 | if (prepare_revision_walk(revs)) |
| 350 | die("revision walk setup failed"); |
| 351 | traverse_commit_list(revs, mark_commit, mark_object, &cp); |
| 352 | } |
| 353 | |
| 354 | display_progress(cp.progress, cp.count); |
| 355 | } |
no test coverage detected