]> Lady’s Gitweb - Gitweb/commit
gitweb: Fix 'grep' search for multiple matches in file
authorJakub Narebski <redacted>
Wed, 15 Feb 2012 16:37:06 +0000 (17:37 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:32 +0000 (00:51 -0400)
commit522dd2e5ade08a3349a0fe5fb0df8b72f391fd93208825b19cc151d3e6227a5f
treed662e0e77f0bb6a38340035afae3c512fd385c935d8622b0b3569286e5818110
parent053713b077eb87270f5bfa4e015a537848ba230a9973231eeaf409dfa2b158dd
gitweb: Fix 'grep' search for multiple matches in file

Commit ff7f218 (gitweb: Fix file links in "grep" search, 2012-01-05),
added $file_href variable, to reduce duplication and have the fix
applied in single place.

Unfortunately it made variable defined inside the loop, not taking into
account the fact that $file_href was set only if file changed.
Therefore for files with multiple matches $file_href was undefined for
second and subsequent matches.

Fix this bug by moving $file_href declaration outside loop.

Adds tests for almost all forms of sarch in gitweb, which were missing
from testuite.  Note that it only tests if there are no warnings, and
it doesn't check that gitweb finds what it should find.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.248523 seconds and 4 git commands to generate.