From 978085b5c6e82ab574b1475f7400177236877b56 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 25 Jul 2026 18:10:36 -1000 Subject: Add max-patch-count to bound the patch view --- tests/t0108-patch.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/t0108-patch.sh b/tests/t0108-patch.sh index 18973bb..ffcba96 100755 --- a/tests/t0108-patch.sh +++ b/tests/t0108-patch.sh @@ -59,4 +59,17 @@ test_expect_success 'compare with output of git-format-patch(1)' ' test_cmp tmp_ tmp2 ' +test_expect_success 'max-patch-count bounds a patch range' ' + { + echo "cache-size=0" && + echo "max-patch-count=2" && + echo "repo.url=foo" && + echo "repo.path=$PWD/repos/foo/.git" + } >patchcountrc && + id=$(git --git-dir="$PWD/repos/foo/.git" rev-parse HEAD) && + root=$(git --git-dir="$PWD/repos/foo/.git" rev-list --max-parents=0 HEAD) && + CGIT_CONFIG="$PWD/patchcountrc" QUERY_STRING="url=foo/patch&id=$id&id2=$root" cgit >tmp && + test $(grep -c "^From " tmp) -eq 2 +' + test_done -- cgit 2.12.1