From 9384c16d6baf6a9a9858fda5512437c1253035b0 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 12:14:12 -1000 Subject: Test the blame link in the file view's header --- tests/t0104-tree.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index ea1f15e..03fd9be 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -336,6 +336,14 @@ test_expect_success 'a listing offers blame only where it works' ' test_grep ! "href=./bin/blame/big.bin.>blame" tmp ' +test_expect_success 'the file view offers blame only for a text file' ' + cgit_ok binblamerc "url=bin/tree/small.txt" >tmp && + test_grep "(plain) (blame)" tmp && + cgit_ok binblamerc "url=bin/tree/blob.bin" >tmp && + test_grep "(plain)" tmp && + test_grep ! ">blame" tmp +' + # The listing sniffs only the window git judges binary by, while blame and # the file view look for a NUL anywhere, so a file whose NUL lies past that # window is offered a blame link that ends on the binary notice. Reading the -- cgit 2.12.1