MCPcopy Create free account
hub / github.com/git/git / have_duplicate_entry

Function have_duplicate_entry

builtin/pack-objects.c:1536–1556  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

1534 * few lines later when we want to add the new entry.
1535 */
1536static 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
1558static int want_cruft_object_mtime(struct repository *r,
1559 const struct object_id *oid,

Callers 3

add_object_entryFunction · 0.85

Calls 2

bitmap_walk_containsFunction · 0.85
packlist_findFunction · 0.85

Tested by

no test coverage detected