@matheusbsbs / matheus-bagliano / commits / 93d5f0619c
Fork 0

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 <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Luben Tuikov committed Jul 23, 2006 at 13:30 UTC 93d5f0619ccf10d7a16834b9e3be38871d2aae6c
1 file changed +3
gitweb/gitweb.cgi
+3
@@ -2326,6 +2326,9 @@ sub git_history {
2326 print "<div>\n" .
2327 $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) . "\n" .
2328 "</div>\n";
2329 + if (!defined $hash && defined $file_name) {
2330 + $hash = git_get_hash_by_path($hash_base, $file_name);
2331 + }
2332 if (defined $hash) {
2333 my $ftype = git_get_type($hash);
2334