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

Function open_loose_object

odb/source-loose.c:235–247  ·  view source on GitHub ↗

* 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(). */

Source from the content-addressed store, hash-verified

233 * call to open_loose_object().
234 */
235static 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
249static void *odb_source_loose_map_object(struct odb_source_loose *loose,
250 const struct object_id *oid,

Callers 1

Calls 1

odb_loose_pathFunction · 0.85

Tested by

no test coverage detected