From e4e49bb81b30ee61e3316b4acf7b3635c36b3ac3 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 1 Nov 2026 17:34:37 -1000 Subject: Say when a log search matches nothing --- tests/t0103-log.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/t0103-log.sh') diff --git a/tests/t0103-log.sh b/tests/t0103-log.sh index 9796394..444db8f 100755 --- a/tests/t0103-log.sh +++ b/tests/t0103-log.sh @@ -45,6 +45,16 @@ test_expect_success 'no links with space in path' '! grep "href=./with space/" t test_expect_success 'no links with space in arg' '! grep "q=commit 1" tmp' test_expect_success 'commit 2 is not visible' '! grep "commit 2" tmp' +# A search that matches nothing says so in a row of its own, rather than +# leaving the table a header with nothing under it. +test_expect_success 'a search matching nothing says so' ' + cgit_url "foo/log&qt=grep&q=no+such+commit" >tmp && + grep "^Status: 200" tmp && + grep "No commits match the search" tmp && + cgit_url "foo/log&qt=grep&q=commit+1" >tmp && + ! grep "No commits match" tmp +' + # Following a file diffs each commit for the name the file had there, so the # root commit that created it has to be diffed too, and paging has to go on # asking about the name the visitor followed rather than the older one. -- cgit 2.12.1