From f7120603edc6f2680ad01fdbe7b3dc7ddf1494ef Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 27 Sep 2026 21:02:41 -1000 Subject: Share the max-blob-size check and its refusal Five copies of the test and four of the error page had to agree by hand. The new check pins the four refusals, which no test covered. --- source/shared.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/shared.h') diff --git a/source/shared.h b/source/shared.h index 46324a1..df18772 100644 --- a/source/shared.h +++ b/source/shared.h @@ -65,6 +65,13 @@ extern int cgit_diff_files(const struct object_id *old_oid, const struct object_ unsigned long *old_size, unsigned long *new_size, int *binary, int context, int ignorews, linediff_fn fn); +/* + * Whether a blob of size bytes is past max-blob-size. Callers ask before + * reading the object, so a huge blob stays out of memory rather than being + * noticed once it is already there. + */ +extern int cgit_blob_too_large(unsigned long size); + /* * Limit a diff to the paths below prefix, which is taken literally. */ -- cgit 2.12.1