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:22:08 +02:00
|
|
|
struct blob *lookup_blob(struct repository *r, const struct object_id *oid)
|
2005-04-18 20:39:48 +02:00
|
|
|
{
|
2018-06-29 03:22:08 +02:00
|
|
|
struct object *obj = lookup_object(r, oid->hash);
|
2007-04-17 07:11:43 +02:00
|
|
|
if (!obj)
|
2018-06-29 03:22:08 +02:00
|
|
|
return create_object(r, oid->hash,
|
|
|
|
alloc_blob_node(r));
|
|
|
|
return object_as_type(r, 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;
|
|
|
|
}
|