From 2a50146723c1bb93b8d15b86884189870cbd0d47 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 12:17:58 -1000 Subject: Test what blame says for paths it cannot blame --- tests/t0104-tree.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 2f77b97..607065b 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -342,6 +342,18 @@ test_expect_success 'a listing offers blame only where it works' ' test_grep ! "href=./bin/blame/big.bin.>blame" tmp ' +# The bin and nested repositories are the ones the tests above built. +test_expect_success 'blame says why it cannot blame a path' ' + cgit_ok binblamerc "url=bin/blame/blob.bin" >tmp && + test_grep "
Blob is binary
" tmp && + cgit_rc nestedrc "url=nested/blame/a" >tmp && + test_grep "^Status: 404" tmp && + test_grep "
Blame is not available for a directory
" tmp && + cgit_rc nestedrc "url=nested/blame/a/no-such-file" >tmp && + test_grep "^Status: 404" tmp && + test_grep "
Not found
" 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 2.12.1