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-Tag: v1.4.2-rc3~33^2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=93d5f0619ccf10d7a16834b9e3be38871d2aae6c;p=git.git 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/gitweb.cgi b/gitweb/gitweb.cgi index 7a61de4a7..c04283ba5 100755 --- a/gitweb/gitweb.cgi +++ b/gitweb/gitweb.cgi @@ -2326,6 +2326,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);