object: add repository argument to create_object
[git/git.git] / blob.c
1 #include "cache.h"
2 #include "blob.h"
3 #include "repository.h"
4
5 const char *blob_type = "blob";
6
7 struct blob *lookup_blob(const struct object_id *oid)
8 {
9 struct object *obj = lookup_object(oid->hash);
10 if (!obj)
11 return create_object(the_repository, oid->hash,
12 alloc_blob_node());
13 return object_as_type(obj, OBJ_BLOB, 0);
14 }
15
16 int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
17 {
18 item->object.parsed = 1;
19 return 0;
20 }