Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Move the directory diff caps test to the limits
Diffstat (limited to 'tests/t0204-limits.sh')
| -rwxr-xr-x | tests/t0204-limits.sh | 19 |
1 file changed, 19 insertions, 0 deletions
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' ' |
