Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/blob.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2022-12-13 14:11:57 +0300
committerJunio C Hamano <gitster@pobox.com>2022-12-13 16:16:22 +0300
commitc1166ca0e23d60629e0e7babd4eb4be64f578286 (patch)
treec2dea0885c731b84a9720fb677fbda2f0b6f47ce /blob.h
parent91e2ab1587d8ee18e3d2978f2b7bc250faf5df8f (diff)
blob: drop unused parts of parse_blob_buffer()
Our parse_blob_buffer() takes a ptr/len combo, just like parse_tree_buffer(), etc, and returns success or failure. But it doesn't actually do anything with them; we just set the "parsed" flag in the object and return success, without even looking at the contents. There could be some value to keeping these unused parameters: - it's consistent with the parse functions for other object types. But we already lost that consistency in 837d395a5c (Replace parse_blob() with an explanatory comment, 2010-01-18). - As the comment from 837d395a5c explains, callers are supposed to make sure they have the object content available. So in theory asking for these parameters could serve as a signal. But there are only two callers, and one of them always passes NULL (after doing a streaming check of the object hash). This shows that there aren't likely to be a lot of callers (since everyone either uses the type-generic parse functions, or handles blobs individually), and that they need to take special care anyway (because we usually want to avoid loading whole blobs in memory if we can avoid it). So let's just drop these unused parameters, and likewise the useless return value. While we're touching the header file, let's move the declaration of parse_blob_buffer() right below that explanatory comment, where it's more likely to be seen by people looking for the function. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'blob.h')
-rw-r--r--blob.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/blob.h b/blob.h
index 1664872055..74555c90c4 100644
--- a/blob.h
+++ b/blob.h
@@ -11,8 +11,6 @@ struct blob {
struct blob *lookup_blob(struct repository *r, const struct object_id *oid);
-int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size);
-
/**
* Blobs do not contain references to other objects and do not have
* structured data that needs parsing. However, code may use the
@@ -21,5 +19,6 @@ int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size);
* parse_blob_buffer() is used (by object.c) to flag that the object
* has been read successfully from the database.
**/
+void parse_blob_buffer(struct blob *item);
#endif /* BLOB_H */