* Find "oid" as a loose object in given source, open the object and return its * file descriptor. Returns the file descriptor on success, negative on failure. * * The "path" out-parameter will give the path of the object we found (if any). * Note that it may point to static storage and is only valid until another * call to open_loose_object(). */
| 233 | * call to open_loose_object(). |
| 234 | */ |
| 235 | static int open_loose_object(struct odb_source_loose *loose, |
| 236 | const struct object_id *oid, const char **path) |
| 237 | { |
| 238 | static struct strbuf buf = STRBUF_INIT; |
| 239 | int fd; |
| 240 | |
| 241 | *path = odb_loose_path(loose, &buf, oid); |
| 242 | fd = git_open(*path); |
| 243 | if (fd >= 0) |
| 244 | return fd; |
| 245 | |
| 246 | return -1; |
| 247 | } |
| 248 | |
| 249 | static void *odb_source_loose_map_object(struct odb_source_loose *loose, |
| 250 | const struct object_id *oid, |
no test coverage detected