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

Function odb_source_files_count_objects

odb/source-files.c:98–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98static int odb_source_files_count_objects(struct odb_source *source,
99 enum odb_count_objects_flags flags,
100 unsigned long *out)
101{
102 struct odb_source_files *files = odb_source_files_downcast(source);
103 unsigned long count;
104 int ret;
105
106 ret = packfile_store_count_objects(files->packed, flags, &count);
107 if (ret < 0)
108 goto out;
109
110 if (!(flags & ODB_COUNT_OBJECTS_APPROXIMATE)) {
111 unsigned long loose_count;
112
113 ret = odb_source_count_objects(&files->loose->base, flags, &loose_count);
114 if (ret < 0)
115 goto out;
116
117 count += loose_count;
118 }
119
120 *out = count;
121 ret = 0;
122
123out:
124 return ret;
125}
126
127static int odb_source_files_find_abbrev_len(struct odb_source *source,
128 const struct object_id *oid,

Callers

nothing calls this directly

Calls 3

odb_source_count_objectsFunction · 0.85

Tested by

no test coverage detected