2005-04-19 02:39:48 +08:00
|
|
|
#include "cache.h"
|
2006-01-07 17:33:54 +08:00
|
|
|
#include "blob.h"
|
2018-05-09 03:37:25 +08:00
|
|
|
#include "repository.h"
|
2018-05-16 05:48:42 +08:00
|
|
|
#include "alloc.h"
|
2005-04-19 02:39:48 +08:00
|
|
|
|
|
|
|
const char *blob_type = "blob";
|
|
|
|
|
2018-06-29 09:22:08 +08:00
|
|
|
struct blob *lookup_blob(struct repository *r, const struct object_id *oid)
|
2005-04-19 02:39:48 +08:00
|
|
|
{
|
2019-06-20 15:41:14 +08:00
|
|
|
struct object *obj = lookup_object(r, oid);
|
2007-04-17 13:11:43 +08:00
|
|
|
if (!obj)
|
2019-06-20 15:41:21 +08:00
|
|
|
return create_object(r, oid, alloc_blob_node(r));
|
2018-06-29 09:22:08 +08:00
|
|
|
return object_as_type(r, obj, OBJ_BLOB, 0);
|
2005-04-19 02:39:48 +08:00
|
|
|
}
|
2005-04-28 22:46:33 +08:00
|
|
|
|
2005-05-07 01:48:34 +08:00
|
|
|
int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
|
|
|
|
{
|
|
|
|
item->object.parsed = 1;
|
|
|
|
return 0;
|
|
|
|
}
|