| 474 | } |
| 475 | |
| 476 | static int everybody_uninteresting(struct prio_queue *orig, |
| 477 | struct commit **interesting_cache) |
| 478 | { |
| 479 | size_t i; |
| 480 | |
| 481 | if (*interesting_cache) { |
| 482 | struct commit *commit = *interesting_cache; |
| 483 | if (!(commit->object.flags & UNINTERESTING)) |
| 484 | return 0; |
| 485 | } |
| 486 | |
| 487 | for (i = 0; i < orig->nr; i++) { |
| 488 | struct commit *commit = orig->array[i].data; |
| 489 | if (commit->object.flags & UNINTERESTING) |
| 490 | continue; |
| 491 | |
| 492 | *interesting_cache = commit; |
| 493 | return 0; |
| 494 | } |
| 495 | return 1; |
| 496 | } |
| 497 | |
| 498 | /* |
| 499 | * A definition of "relevant" commit that we can use to simplify limited graphs |