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

Function packfile_store_count_objects

packfile.c:1106–1135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1104}
1105
1106int packfile_store_count_objects(struct packfile_store *store,
1107 enum odb_count_objects_flags flags UNUSED,
1108 unsigned long *out)
1109{
1110 struct packfile_list_entry *e;
1111 struct multi_pack_index *m;
1112 unsigned long count = 0;
1113 int ret;
1114
1115 m = get_multi_pack_index(store->source);
1116 if (m)
1117 count += m->num_objects + m->num_objects_in_base;
1118
1119 for (e = packfile_store_get_packs(store); e; e = e->next) {
1120 if (e->pack->multi_pack_index)
1121 continue;
1122 if (open_pack_index(e->pack)) {
1123 ret = -1;
1124 goto out;
1125 }
1126
1127 count += e->pack->num_objects;
1128 }
1129
1130 *out = count;
1131 ret = 0;
1132
1133out:
1134 return ret;
1135}
1136
1137unsigned long unpack_object_header_buffer(const unsigned char *buf,
1138 unsigned long len, enum object_type *type, size_t *sizep)

Callers 1

Calls 3

get_multi_pack_indexFunction · 0.85
packfile_store_get_packsFunction · 0.85
open_pack_indexFunction · 0.85

Tested by

no test coverage detected