🌐 AI搜索 & 代理 主页
blob: 1fcb8e44b00f3b9eedbe92da8abe47c2bebca7c7 [file] [log] [blame]
Daniel Barkalow175785e2005-04-18 18:39:481#include "cache.h"
Junio C Hamano8f1d2e62006-01-07 09:33:542#include "blob.h"
Daniel Barkalow175785e2005-04-18 18:39:483
4const char *blob_type = "blob";
5
Jason McMullan5d6ccf52005-06-03 15:05:396struct blob *lookup_blob(const unsigned char *sha1)
Daniel Barkalow175785e2005-04-18 18:39:487{
8 struct object *obj = lookup_object(sha1);
Linus Torvalds100c5f32007-04-17 05:11:439 if (!obj)
Jeff Kingd36f51c2014-07-13 06:41:5510 return create_object(sha1, alloc_blob_node());
Jeff King8ff226a2014-07-13 06:42:0311 return object_as_type(obj, OBJ_BLOB, 0);
Daniel Barkalow175785e2005-04-18 18:39:4812}
Daniel Barkalowa510bfa2005-04-28 14:46:3313
Nicolas Pitrebd2c39f2005-05-06 17:48:3414int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
15{
16 item->object.parsed = 1;
17 return 0;
18}