blob: 1fcb8e44b00f3b9eedbe92da8abe47c2bebca7c7 [file] [log] [blame]
Daniel Barkalow175785e2005-04-18 11:39:48 -07001#include "cache.h"
Junio C Hamano8f1d2e62006-01-07 01:33:54 -08002#include "blob.h"
Daniel Barkalow175785e2005-04-18 11:39:48 -07003
4const char *blob_type = "blob";
5
Jason McMullan5d6ccf52005-06-03 11:05:39 -04006struct blob *lookup_blob(const unsigned char *sha1)
Daniel Barkalow175785e2005-04-18 11:39:48 -07007{
8 struct object *obj = lookup_object(sha1);
Linus Torvalds100c5f32007-04-16 22:11:43 -07009 if (!obj)
Jeff Kingd36f51c2014-07-13 02:41:55 -040010 return create_object(sha1, alloc_blob_node());
Jeff King8ff226a2014-07-13 02:42:03 -040011 return object_as_type(obj, OBJ_BLOB, 0);
Daniel Barkalow175785e2005-04-18 11:39:48 -070012}
Daniel Barkalowa510bfa2005-04-28 07:46:33 -070013
Nicolas Pitrebd2c39f2005-05-06 13:48:34 -040014int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
15{
16 item->object.parsed = 1;
17 return 0;
18}