From 1be85369f36458fe9a2f85ca63285367f94e6172 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 06:26:24 -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