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 'tests/t0204-limits.sh')
| -rwxr-xr-x | tests/t0204-limits.sh | 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 18 insertions, 0 deletions
diff --git a/tests/t0204-limits.sh b/tests/t0204-limits.sh index b1c797a..2d33368 100755 --- a/tests/t0204-limits.sh +++ b/tests/t0204-limits.sh @@ -214,4 +214,22 @@ test_expect_success LUA 'highlight filter passes text through without scintillua grep "int y;" tmp ' +# The patch and rawdiff pages hand the work to git, whose own limit on an +# inlined blob is far past max-blob-size, so the cap is passed through to it. +test_expect_success 'patch and rawdiff show an oversized blob as binary' ' + test_seq 1 2000 >repos/limits/big.txt && + git -C repos/limits add big.txt && + git -C repos/limits commit -q -m "big blob" && + { + echo "max-blob-size=1" && + cat limitrc + } >blobrc && + for p in patch rawdiff + do + CGIT_CONFIG="$PWD/blobrc" QUERY_STRING="url=limits/$p/" cgit >tmp && + grep "^Binary files" tmp && + ! grep "^+1999$" tmp || return 1 + done +' + test_done |
