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