Diff options
| -rwxr-xr-x | tests/t0204-limits.sh | 19 | |
| -rwxr-xr-x | tests/t0303-robustness.sh | 21 |
2 files changed, 19 insertions, 21 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' ' diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index 1301f5c..6fc29ec 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -544,27 +544,6 @@ test_expect_success 'a refs page named with an id is not cached for ever' ' test_grep ! ">later<" tmp ' -test_expect_success 'the diff caps hold when the path names a directory' ' - ( - cd repos/rob && - mkdir -p dir && - for n in 1 2 3 - do - echo $n >dir/f$n || return 1 - done && - git add dir && - git commit -m dir - ) && - { - echo "max-diff-files=2" && - cat robrc - } >caprc && - cgit_rc caprc "url=rob/diff/dir" >tmp && - grep "too large to be rendered inline" tmp && - cgit_rc caprc "url=rob/diff/dir/f1" >tmp && - ! grep "too large to be rendered inline" tmp -' - test_lazy_prereq GZIP 'command -v gzip' test_expect_success GZIP 'a snapshot of a tag spelled like an option is archived' ' |
