| 281 | } |
| 282 | |
| 283 | void mark_edges_uninteresting(struct rev_info *revs, |
| 284 | show_edge_fn show_edge, |
| 285 | int sparse) |
| 286 | { |
| 287 | struct commit_list *list; |
| 288 | |
| 289 | if (sparse) { |
| 290 | struct oidset set; |
| 291 | oidset_init(&set, 16); |
| 292 | |
| 293 | for (list = revs->commits; list; list = list->next) { |
| 294 | struct commit *commit = list->item; |
| 295 | struct tree *tree = repo_get_commit_tree(the_repository, |
| 296 | commit); |
| 297 | |
| 298 | if (commit->object.flags & UNINTERESTING) |
| 299 | tree->object.flags |= UNINTERESTING; |
| 300 | |
| 301 | oidset_insert(&set, &tree->object.oid); |
| 302 | add_edge_parents(commit, revs, show_edge, &set); |
| 303 | } |
| 304 | |
| 305 | mark_trees_uninteresting_sparse(revs->repo, &set); |
| 306 | oidset_clear(&set); |
| 307 | } else { |
| 308 | for (list = revs->commits; list; list = list->next) { |
| 309 | struct commit *commit = list->item; |
| 310 | if (commit->object.flags & UNINTERESTING) { |
| 311 | mark_tree_uninteresting(revs->repo, |
| 312 | repo_get_commit_tree(the_repository, commit)); |
| 313 | if (revs->edge_hint_aggressive && !(commit->object.flags & SHOWN)) { |
| 314 | commit->object.flags |= SHOWN; |
| 315 | show_edge(commit); |
| 316 | } |
| 317 | continue; |
| 318 | } |
| 319 | mark_edge_parents_uninteresting(commit, revs, show_edge); |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | if (revs->edge_hint_aggressive) { |
| 324 | for (size_t i = 0; i < revs->cmdline.nr; i++) { |
| 325 | struct object *obj = revs->cmdline.rev[i].item; |
| 326 | struct commit *commit = (struct commit *)obj; |
| 327 | if (obj->type != OBJ_COMMIT || !(obj->flags & UNINTERESTING)) |
| 328 | continue; |
| 329 | mark_tree_uninteresting(revs->repo, |
| 330 | repo_get_commit_tree(the_repository, commit)); |
| 331 | if (!(obj->flags & SHOWN)) { |
| 332 | obj->flags |= SHOWN; |
| 333 | show_edge(commit); |
| 334 | } |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | static void add_pending_tree(struct rev_info *revs, struct tree *tree) |
| 340 | { |
no test coverage detected