diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-01-31 13:14:57 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-31 13:14:57 -0800 |
commit | 42ace93e41da0abe5a264fb8661f1c7de88206ec (patch) | |
tree | 937299b26d761c4b1729f86de23c7cad833261cc /cache.h | |
parent | e8272fd5fbb4f3a6d264fe0721247efe08aada8f (diff) | |
parent | cce044df7f2392d0c6cb21d6dca94f01ff838727 (diff) | |
download | git-42ace93e41da0abe5a264fb8661f1c7de88206ec.tar.gz git-42ace93e41da0abe5a264fb8661f1c7de88206ec.tar.xz |
Merge branch 'jk/loose-object-fsck'
"git fsck" inspects loose objects more carefully now.
* jk/loose-object-fsck:
fsck: detect trailing garbage in all object types
fsck: parse loose object paths directly
sha1_file: add read_loose_object() function
t1450: test fsck of packed objects
sha1_file: fix error message for alternate objects
t1450: refactor loose-object removal
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1143,6 +1143,19 @@ extern int finalize_object_file(const char *tmpfile, const char *filename); extern int has_sha1_pack(const unsigned char *sha1); /* + * Open the loose object at path, check its sha1, and return the contents, + * type, and size. If the object is a blob, then "contents" may return NULL, + * to allow streaming of large blobs. + * + * Returns 0 on success, negative on error (details may be written to stderr). + */ +int read_loose_object(const char *path, + const unsigned char *expected_sha1, + enum object_type *type, + unsigned long *size, + void **contents); + +/* * Return true iff we have an object named sha1, whether local or in * an alternate object database, and whether packed or loose. This * function does not respect replace references. |