| Daniel Barkalow | 175785e | 2005-04-18 18:39:48 | [diff] [blame] | 1 | #include "cache.h" |
| Junio C Hamano | 8f1d2e6 | 2006-01-07 09:33:54 | [diff] [blame] | 2 | #include "blob.h" |
| Stefan Beller | 68f95d3 | 2018-05-08 19:37:25 | [diff] [blame] | 3 | #include "repository.h" |
| Stefan Beller | 14ba97f | 2018-05-15 21:48:42 | [diff] [blame] | 4 | #include "alloc.h" |
| Daniel Barkalow | 175785e | 2005-04-18 18:39:48 | [diff] [blame] | 5 | |
| 6 | const char *blob_type = "blob"; | ||||
| 7 | |||||
| Stefan Beller | 17126cd | 2018-06-29 01:22:08 | [diff] [blame] | 8 | struct blob *lookup_blob(struct repository *r, const struct object_id *oid) |
| Daniel Barkalow | 175785e | 2005-04-18 18:39:48 | [diff] [blame] | 9 | { |
| Jeff King | d0229ab | 2019-06-20 07:41:14 | [diff] [blame] | 10 | struct object *obj = lookup_object(r, oid); |
| Linus Torvalds | 100c5f3 | 2007-04-17 05:11:43 | [diff] [blame] | 11 | if (!obj) |
| Jeff King | a378509 | 2019-06-20 07:41:21 | [diff] [blame] | 12 | return create_object(r, oid, alloc_blob_node(r)); |
| Abhishek Kumar | 6da43d9 | 2020-06-17 09:14:08 | [diff] [blame] | 13 | return object_as_type(obj, OBJ_BLOB, 0); |
| Daniel Barkalow | 175785e | 2005-04-18 18:39:48 | [diff] [blame] | 14 | } |
| Daniel Barkalow | a510bfa | 2005-04-28 14:46:33 | [diff] [blame] | 15 | |
| Nicolas Pitre | bd2c39f | 2005-05-06 17:48:34 | [diff] [blame] | 16 | int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size) |
| 17 | { | ||||
| 18 | item->object.parsed = 1; | ||||
| 19 | return 0; | ||||
| 20 | } | ||||