From 8c3e21ccd3be25da61eba45a6c773eeacd7d3a7d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 14 Oct 2026 20:39:19 -1000 Subject: Search the log literally as intended setup_revisions compiles the pattern itself, and the literal type cgit set afterwards came too late, so text that was no valid regular expression, such as an unbalanced bracket, ended in a 500. --- tests/t0103-log.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/t0103-log.sh b/tests/t0103-log.sh index 9671e7f..573baa8 100755 --- a/tests/t0103-log.sh +++ b/tests/t0103-log.sh @@ -110,4 +110,13 @@ test_expect_success 'the log draws the commit graph when enabled' ' grep "class=.commitgraph." tmp ' +# The search is literal, so text that is no valid regular expression still +# finds the commit holding it. +test_expect_success 'a search for brackets matches them literally' ' + git -C repos/foo commit --allow-empty -m "fix [brackets] in docs" && + cgit_url "foo/log&qt=grep&q=%5Bbrackets" >tmp && + grep "^Status: 200" tmp && + grep "fix \\[brackets\\] in docs" tmp +' + test_done -- cgit 2.12.1