]> git.ipfire.org Git - thirdparty/git.git/blobdiff - cache.h
Merge branch 'ab/object-file-api-updates'
[thirdparty/git.git] / cache.h
diff --git a/cache.h b/cache.h
index 9e3d423b95176cbaabdf9cabb85bced73cd0bd21..0bc0a37cecbfdcec436dbd26546d2d78190e0173 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1320,9 +1320,23 @@ enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
 struct object_info;
 int parse_loose_header(const char *hdr, struct object_info *oi);
 
+/**
+ * With in-core object data in "buf", rehash it to make sure the
+ * object name actually matches "oid" to detect object corruption.
+ *
+ * A negative value indicates an error, usually that the OID is not
+ * what we expected, but it might also indicate another error.
+ */
 int check_object_signature(struct repository *r, const struct object_id *oid,
-                          void *buf, unsigned long size, const char *type,
-                          struct object_id *real_oidp);
+                          void *map, unsigned long size,
+                          enum object_type type);
+
+/**
+ * A streaming version of check_object_signature().
+ * Try reading the object named with "oid" using
+ * the streaming interface and rehash it to do the same.
+ */
+int stream_object_signature(struct repository *r, const struct object_id *oid);
 
 int finalize_object_file(const char *tmpfile, const char *filename);
 
@@ -1549,7 +1563,7 @@ int cache_name_stage_compare(const char *name1, int len1, int stage1, const char
 
 void *read_object_with_reference(struct repository *r,
                                 const struct object_id *oid,
-                                const char *required_type,
+                                enum object_type required_type,
                                 unsigned long *size,
                                 struct object_id *oid_ret);