* When adding an object, check whether we have already added it * to our packing list. If so, we can skip. However, if we are * being asked to excludei t, but the previous mention was to include * it, make sure to adjust its flags and tweak our numbers accordingly. * * As an optimization, we pass out the index position where we would have * found the item, since that saves us from having to
| 1534 | * few lines later when we want to add the new entry. |
| 1535 | */ |
| 1536 | static int have_duplicate_entry(const struct object_id *oid, |
| 1537 | int exclude) |
| 1538 | { |
| 1539 | struct object_entry *entry; |
| 1540 | |
| 1541 | if (reuse_packfile_bitmap && |
| 1542 | bitmap_walk_contains(bitmap_git, reuse_packfile_bitmap, oid)) |
| 1543 | return 1; |
| 1544 | |
| 1545 | entry = packlist_find(&to_pack, oid); |
| 1546 | if (!entry) |
| 1547 | return 0; |
| 1548 | |
| 1549 | if (exclude) { |
| 1550 | if (!entry->preferred_base) |
| 1551 | nr_result--; |
| 1552 | entry->preferred_base = 1; |
| 1553 | } |
| 1554 | |
| 1555 | return 1; |
| 1556 | } |
| 1557 | |
| 1558 | static int want_cruft_object_mtime(struct repository *r, |
| 1559 | const struct object_id *oid, |
no test coverage detected