commit-graph: return generation from memory
[alt-git.git] / blob.c
blob8f83523b0cde6dbf1b808b3dcf8ab1c1c23085f3
1 #include "cache.h"
2 #include "blob.h"
3 #include "repository.h"
4 #include "alloc.h"
6 const char *blob_type = "blob";
8 struct blob *lookup_blob(struct repository *r, const struct object_id *oid)
10 struct object *obj = lookup_object(r, oid);
11 if (!obj)
12 return create_object(r, oid, alloc_blob_node(r));
13 return object_as_type(obj, OBJ_BLOB, 0);
16 void parse_blob_buffer(struct blob *item)
18 item->object.parsed = 1;