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