🌐 AI搜索 & 代理 主页
blob: 182718aba9fe320f1064a12fb5baf1969f563b29 [file] [log] [blame]
Daniel Barkalow175785e2005-04-18 18:39:481#include "cache.h"
Junio C Hamano8f1d2e62006-01-07 09:33:542#include "blob.h"
Stefan Beller68f95d32018-05-08 19:37:253#include "repository.h"
Stefan Beller14ba97f2018-05-15 21:48:424#include "alloc.h"
Daniel Barkalow175785e2005-04-18 18:39:485
6const char *blob_type = "blob";
7
Stefan Beller17126cd2018-06-29 01:22:088struct blob *lookup_blob(struct repository *r, const struct object_id *oid)
Daniel Barkalow175785e2005-04-18 18:39:489{
Jeff Kingd0229ab2019-06-20 07:41:1410 struct object *obj = lookup_object(r, oid);
Linus Torvalds100c5f32007-04-17 05:11:4311 if (!obj)
Jeff Kinga3785092019-06-20 07:41:2112 return create_object(r, oid, alloc_blob_node(r));
Abhishek Kumar6da43d92020-06-17 09:14:0813 return object_as_type(obj, OBJ_BLOB, 0);
Daniel Barkalow175785e2005-04-18 18:39:4814}
Daniel Barkalowa510bfa2005-04-28 14:46:3315
Nicolas Pitrebd2c39f2005-05-06 17:48:3416int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
17{
18 item->object.parsed = 1;
19 return 0;
20}