From 83636020a3a9ba39cc96aa03b003c99ef973ca2e Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 17 Oct 2026 17:09:15 -1000 Subject: Hold patch and rawdiff to max-blob-size Both pages hand the diff to git, whose own limit on an inlined blob is 512 MB, so a commit adding a blob the other views refuse was inflated and diffed in full. The cap is passed through to git, which shows such a blob as binary. --- source/ui-diff.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/ui-diff.c') diff --git a/source/ui-diff.c b/source/ui-diff.c index f133a9c..2da44c4 100644 --- a/source/ui-diff.c +++ b/source/ui-diff.c @@ -540,6 +540,10 @@ static void print_raw_patch(const struct object_id *old_tree_oid, const struct o { struct diff_options diffopt; + // As on the patch page, a blob past max-blob-size is shown as binary + // rather than inflated. + if (ctx.cfg.max_blob_size) + repo_settings_set_big_file_threshold(the_repository, (unsigned long)ctx.cfg.max_blob_size * 1024); repo_diff_setup(the_repository, &diffopt); diffopt.output_format = DIFF_FORMAT_PATCH; diffopt.flags.recursive = 1; -- cgit