]> Lady’s Gitweb - Gitweb/commit
gitweb: Fix file links in "grep" search
authorJakub Narebski <redacted>
Thu, 5 Jan 2012 20:26:48 +0000 (21:26 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:31 +0000 (00:51 -0400)
commit860386bfb01a1d9c04d867d95868f3f15cb43acfacdb2ae7d262f2ca7228de89
treed7a6f62f37cf8fca00d6798aba1b0fe245f9b9faf097231715391e3495bf6c23
parent1ffb8bae6c78d1c4956c899bbe879530523bfb0a9f514522210bb24cbaab4507
gitweb: Fix file links in "grep" search

There were two bugs in generating file links (links to "blob" view),
one hidden by the other.  The correct way of generating file link is

href(action=>"blob", hash_base=>$co{'id'},
     file_name=>$file);

It was $co{'hash'} (this key does not exist, and therefore this is
undef), and 'hash' instead of 'hash_base'.

To have this fix applied in single place, this commit also reduces
code duplication by saving file link (which is used for line links) in
$file_href.

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