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

Function show_object_pack_hint

builtin/pack-objects.c:3834–3863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3832}
3833
3834static void show_object_pack_hint(struct object *object, const char *name,
3835 void *data)
3836{
3837 enum stdin_packs_mode mode = *(enum stdin_packs_mode *)data;
3838 if (mode == STDIN_PACKS_MODE_FOLLOW) {
3839 if (object->type == OBJ_BLOB &&
3840 !odb_has_object(the_repository->objects, &object->oid, 0))
3841 return;
3842 add_object_entry(&object->oid, object->type, name, 0);
3843 } else {
3844 struct object_entry *oe = packlist_find(&to_pack, &object->oid);
3845 if (!oe)
3846 return;
3847
3848 /*
3849 * Our 'to_pack' list was constructed by iterating all
3850 * objects packed in included packs, and so doesn't have
3851 * a non-zero hash field that you would typically pick
3852 * up during a reachability traversal.
3853 *
3854 * Make a best-effort attempt to fill in the ->hash and
3855 * ->no_try_delta fields here in order to perhaps
3856 * improve the delta selection process.
3857 */
3858 oe->hash = pack_name_hash_fn(name);
3859 oe->no_try_delta = name && no_try_delta(name);
3860
3861 stdin_packs_hints_nr++;
3862 }
3863}
3864
3865static void show_commit_pack_hint(struct commit *commit, void *data)
3866{

Callers 1

show_commit_pack_hintFunction · 0.85

Calls 5

odb_has_objectFunction · 0.85
add_object_entryFunction · 0.85
packlist_findFunction · 0.85
pack_name_hash_fnFunction · 0.85
no_try_deltaFunction · 0.85

Tested by

no test coverage detected