blob.c 485 Bytes
Newer Older
1
#include "cache.h"
2
#include "blob.h"
3
#include "repository.h"
4
#include "alloc.h"
5 6 7

const char *blob_type = "blob";

8
struct blob *lookup_blob(struct repository *r, const struct object_id *oid)
9
{
10
	struct object *obj = lookup_object(r, oid->hash);
11
	if (!obj)
12 13 14
		return create_object(r, oid->hash,
				     alloc_blob_node(r));
	return object_as_type(r, obj, OBJ_BLOB, 0);
15
}
16

17 18 19 20 21
int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
{
	item->object.parsed = 1;
	return 0;
}