diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
Diffstat (limited to 'source/ui-patch.c')
| -rw-r--r-- | source/ui-patch.c | 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 4 insertions, 0 deletions
diff --git a/source/ui-patch.c b/source/ui-patch.c index 7191542..525e660 100644 --- a/source/ui-patch.c +++ b/source/ui-patch.c @@ -97,6 +97,10 @@ void cgit_print_patch(const char *new_rev, const char *old_rev, const char *pref "From: %an%nDate: %aD%n%w(78,0,1)Subject: %s%n%n%w(0)%b"; } + // Git inlines a blob up to its own big-file threshold, far past what + // any other view inflates, so max-blob-size is applied through it. + if (ctx.cfg.max_blob_size) + repo_settings_set_big_file_threshold(the_repository, (unsigned long)ctx.cfg.max_blob_size * 1024); repo_init_revisions(the_repository, &rev, NULL); rev.abbrev = DEFAULT_ABBREV; rev.verbose_header = 1; |
