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