Diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/parsing.c | 12 |
1 file changed, 11 insertions, 1 deletion
diff --git a/source/parsing.c b/source/parsing.c index f684241..909a288 100644 --- a/source/parsing.c +++ b/source/parsing.c @@ -24,11 +24,21 @@ static int mailmap_read; struct string_list *cgit_mailmap(void) { + struct object_id oid; + size_t size; + if (!ctx.repo || !ctx.repo->enable_mailmap) return NULL; if (!mailmap_read) { mailmap_read = 1; - read_mailmap_blob(the_repository, &mailmap, "HEAD:.mailmap"); + // git reads the blob whole, so it is held to the same bound as + // every other blob a page inflates. + if ( + !repo_get_oid(the_repository, "HEAD:.mailmap", &oid) && + odb_read_object_info(the_repository->objects, &oid, &size) == OBJ_BLOB && + !cgit_blob_too_large(size) + ) + read_mailmap_blob(the_repository, &mailmap, "HEAD:.mailmap"); } return mailmap.nr ? &mailmap : NULL; } |
