From: Jakub Narebski Date: Wed, 15 Feb 2012 16:37:06 +0000 (+0100) Subject: gitweb: Fix 'grep' search for multiple matches in file X-Git-Tag: v1.7.9.2~19 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/fc8fcd27e67ad06689a823dd83a929624e359cc1?ds=inline;hp=fc8fcd27e67ad06689a823dd83a929624e359cc1 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 Signed-off-by: Junio C Hamano ---