]> git.ipfire.org Git - thirdparty/git.git/blame - blob.c
git-submodule.sh: shorten submodule SHA-1s using rev-parse
[thirdparty/git.git] / blob.c
CommitLineData
175785e5 1#include "cache.h"
8f1d2e6f 2#include "blob.h"
68f95d38 3#include "repository.h"
14ba97f8 4#include "alloc.h"
175785e5
DB
5
6const char *blob_type = "blob";
7
17126cdf 8struct blob *lookup_blob(struct repository *r, const struct object_id *oid)
175785e5 9{
17126cdf 10 struct object *obj = lookup_object(r, oid->hash);
100c5f3b 11 if (!obj)
17126cdf
SB
12 return create_object(r, oid->hash,
13 alloc_blob_node(r));
14 return object_as_type(r, obj, OBJ_BLOB, 0);
175785e5 15}
a510bfaa 16
bd2c39f5
NP
17int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
18{
19 item->object.parsed = 1;
20 return 0;
21}