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

Function get_object_details

builtin/pack-objects.c:2605–2639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2603}
2604
2605static void get_object_details(void)
2606{
2607 uint32_t i;
2608 struct object_entry **sorted_by_offset;
2609
2610 if (progress)
2611 progress_state = start_progress(the_repository,
2612 _("Counting objects"),
2613 to_pack.nr_objects);
2614
2615 CALLOC_ARRAY(sorted_by_offset, to_pack.nr_objects);
2616 for (i = 0; i < to_pack.nr_objects; i++)
2617 sorted_by_offset[i] = to_pack.objects + i;
2618 QSORT(sorted_by_offset, to_pack.nr_objects, pack_offset_sort);
2619
2620 for (i = 0; i < to_pack.nr_objects; i++) {
2621 struct object_entry *entry = sorted_by_offset[i];
2622 check_object(entry, i);
2623 if (entry->type_valid &&
2624 oe_size_greater_than(&to_pack, entry,
2625 repo_settings_get_big_file_threshold(the_repository)))
2626 entry->no_try_delta = 1;
2627 display_progress(progress_state, i + 1);
2628 }
2629 stop_progress(&progress_state);
2630
2631 /*
2632 * This must happen in a second pass, since we rely on the delta
2633 * information for the whole list being completed.
2634 */
2635 for (i = 0; i < to_pack.nr_objects; i++)
2636 break_delta_chains(&to_pack.objects[i]);
2637
2638 free(sorted_by_offset);
2639}
2640
2641/*
2642 * We search for deltas in a list sorted by type, by filename hash, and then

Callers 1

prepare_packFunction · 0.85

Calls 7

start_progressFunction · 0.85
oe_size_greater_thanFunction · 0.85
display_progressFunction · 0.85
stop_progressFunction · 0.85
break_delta_chainsFunction · 0.85
check_objectFunction · 0.70

Tested by

no test coverage detected