]> Lady’s Gitweb - Gitweb/commitdiff
gitweb.cgi: Show "raw" head of project link even when $hash is not defined
authorLuben Tuikov <redacted>
Sun, 23 Jul 2006 20:30:08 +0000 (13:30 -0700)
committerLady <redacted>
Sat, 4 Apr 2026 18:43:37 +0000 (14:43 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.cgi

index 8455d42b300a353400e08f8ad85994e1ec91727e60de2f2ef5d56f173ac4f2b5..ca8a2eee732df011cadea3b3bbc66774c2bd9873a05fcd81269f6b31a378131b 100755 (executable)
@@ -2401,6 +2401,9 @@ sub git_history {
        print "<div>\n" .
              $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) . "\n" .
              "</div>\n";
        print "<div>\n" .
              $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) . "\n" .
              "</div>\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);
 
        if (defined $hash) {
                my $ftype = git_get_type($hash);
 
This page took 0.198187 seconds and 4 git commands to generate.