From 090304da003a469e998dc54b998c92949fb4f443 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 17 Oct 2026 17:09:12 -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