From 32a32cf8c2f0ca528b05bffa0505cf91848ebea7 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 12:12:37 -1000 Subject: Prove the rows the blame link check looks past The checks that blob.bin, big.bin and large.txt get no blame link never showed those rows were in the listing, so a listing that dropped them passed. --- tests/t0104-tree.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 2a7c741..ea1f15e 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -315,7 +315,8 @@ test_expect_success 'a large binary is dumped only in part' ' ' # The blame page refuses a file git counts as binary and one past -# max-blob-size, so a listing offers blame for neither. +# max-blob-size, so a listing offers blame for neither. The two binaries are +# the ones the tests above committed. test_expect_success 'a listing offers blame only where it works' ' ( cd repos/bin && @@ -325,11 +326,14 @@ test_expect_success 'a listing offers blame only where it works' ' git commit -m "text files" ) && cgitrc_repo binblamerc bin enable-blame=1 max-blob-size=4 && - cgit_rc binblamerc "url=bin/tree/" >tmp && - grep "href=./bin/blame/small.txt.>blame" tmp && - ! grep "href=./bin/blame/large.txt.>blame" tmp && - ! grep "href=./bin/blame/blob.bin.>blame" tmp && - ! grep "href=./bin/blame/big.bin.>blame" tmp + cgit_ok binblamerc "url=bin/tree/" >tmp && + test_grep "href=./bin/tree/large.txt.>large.txt" tmp && + test_grep "href=./bin/tree/blob.bin.>blob.bin" tmp && + test_grep "href=./bin/tree/big.bin.>big.bin" tmp && + test_grep "href=./bin/blame/small.txt.>blame" tmp && + test_grep ! "href=./bin/blame/large.txt.>blame" tmp && + test_grep ! "href=./bin/blame/blob.bin.>blame" tmp && + test_grep ! "href=./bin/blame/big.bin.>blame" tmp ' # The listing sniffs only the window git judges binary by, while blame and -- cgit 2.12.1