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