From: Luben Tuikov Date: Sun, 23 Jul 2006 20:30:08 +0000 (-0700) Subject: gitweb.cgi: Show "raw" head of project link even when $hash is not defined X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/dfbd146ac6efe32127e8a2b0da341f32b4e79c1af0cbe1be2483cb2fe7801adc?hp=3c0d9cfab1bd092216f7a2f9273106ee27f42babc1d342aa8006086f778fa155 gitweb.cgi: Show "raw" head of project link even when $hash is not defined Some callers of git_history() do not set $hash of $file_name. Add code to find it, if it is not defined. Signed-off-by: Luben Tuikov Signed-off-by: Junio C Hamano --- diff --git a/gitweb.cgi b/gitweb.cgi index 8455d42..ca8a2ee 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -2401,6 +2401,9 @@ sub git_history { print "
\n" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) . "\n" . "
\n"; + if (!defined $hash && defined $file_name) { + $hash = git_get_hash_by_path($hash_base, $file_name); + } if (defined $hash) { my $ftype = git_get_type($hash);