diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
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.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/t0103-log.sh9
1 file changed, 9 insertions, 0 deletions
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