| 96 | } |
| 97 | |
| 98 | static 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 | |
| 123 | out: |
| 124 | return ret; |
| 125 | } |
| 126 | |
| 127 | static int odb_source_files_find_abbrev_len(struct odb_source *source, |
| 128 | const struct object_id *oid, |
nothing calls this directly
no test coverage detected