From 5be0cbfd2734ed8f514b87f8d49eb431f719a779 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 17:48:17 -1000 Subject: Move the directory diff caps test to the limits --- tests/t0204-limits.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/t0204-limits.sh') diff --git a/tests/t0204-limits.sh b/tests/t0204-limits.sh index da50018..d2151c6 100755 --- a/tests/t0204-limits.sh +++ b/tests/t0204-limits.sh @@ -165,6 +165,25 @@ test_expect_success 'the single-file page is not limited by max-diff-files' ' test_grep "class=.hunk." tmp ' +# A path naming a directory still covers every file below it, so the caps +# go on applying there. +test_expect_success 'the diff caps hold when the path names a directory' ' + test_create_repo repos/capdir && + mkdir repos/capdir/dir && + for n in 1 2 3 + do + echo $n >repos/capdir/dir/f$n || return 1 + done && + git -C repos/capdir add dir && + git -C repos/capdir commit -q -m dir && + cgitrc_repo capdirrc capdir max-diff-files=2 && + cgit_ok capdirrc "url=capdir/diff/dir" >tmp && + test_grep "too large to be rendered inline" tmp && + cgit_ok capdirrc "url=capdir/diff/dir/f1" >tmp && + test_grep "class=.hunk." tmp && + test_grep ! "too large to be rendered inline" tmp +' + # The patch the notice links to has to hold the change the page compared, # both ends of a range and a branch other than the default. test_expect_success 'the stat only notice links the patch of the same change' ' -- cgit 2.12.1