| 182 | } |
| 183 | |
| 184 | int read_mailmap_blob(struct repository *repo, struct string_list *map, |
| 185 | const char *name) |
| 186 | { |
| 187 | struct object_id oid; |
| 188 | char *buf; |
| 189 | size_t size; |
| 190 | enum object_type type; |
| 191 | |
| 192 | if (!name) |
| 193 | return 0; |
| 194 | if (repo_get_oid(repo, name, &oid) < 0) |
| 195 | return 0; |
| 196 | |
| 197 | buf = odb_read_object(repo->objects, &oid, &type, &size); |
| 198 | if (!buf) |
| 199 | return error("unable to read mailmap object at %s", name); |
| 200 | if (type != OBJ_BLOB) { |
| 201 | free(buf); |
| 202 | return error("mailmap is not a blob: %s", name); |
| 203 | } |
| 204 | |
| 205 | read_mailmap_string(map, buf); |
| 206 | |
| 207 | free(buf); |
| 208 | return 0; |
| 209 | } |
| 210 | |
| 211 | int read_mailmap(struct repository *repo, struct string_list *map) |
| 212 | { |
no test coverage detected