mirror of
https://github.com/git/git.git
synced 2024-11-24 02:17:02 +08:00
3aca1fc6c9
Convert lookup_blob to take a pointer to struct object_id. The commit was created with manual changes to blob.c and blob.h, plus the following semantic patch: @@ expression E1; @@ - lookup_blob(E1.hash) + lookup_blob(&E1) @@ expression E1; @@ - lookup_blob(E1->hash) + lookup_blob(E1) Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 lines
401 B
C
19 lines
401 B
C
#include "cache.h"
|
|
#include "blob.h"
|
|
|
|
const char *blob_type = "blob";
|
|
|
|
struct blob *lookup_blob(const struct object_id *oid)
|
|
{
|
|
struct object *obj = lookup_object(oid->hash);
|
|
if (!obj)
|
|
return create_object(oid->hash, alloc_blob_node());
|
|
return object_as_type(obj, OBJ_BLOB, 0);
|
|
}
|
|
|
|
int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
|
|
{
|
|
item->object.parsed = 1;
|
|
return 0;
|
|
}
|