]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.cgi
gitweb.cgi: Show "raw" head of project link even when $hash is not defined
[Gitweb] / gitweb.cgi
index 12dbc9cc9bea2cf4368688dff38f09881d98f9f15fde32302b4759aef23945c0..ca8a2eee732df011cadea3b3bbc66774c2bd9873a05fcd81269f6b31a378131b 100755 (executable)
@@ -2012,7 +2012,13 @@ sub git_commit {
                print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash")}, "commitdiff");
        }
        print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash")}, "tree") . "\n" .
-             "<br/><br/></div>\n";
+               "<br/>\n";
+       if (defined $file_name && defined $co{'parent'}) {
+               my $parent = $co{'parent'};
+               print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;hb=$parent;f=$file_name")}, "blame") . "\n";
+       }
+       print "<br/></div>\n";
+
        if (defined $co{'parent'}) {
                print "<div>\n" .
                      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash"), -class => "title"}, esc_html($co{'title'}) . $ref) . "\n" .
@@ -2395,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";
+       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);
 
This page took 0.206285 seconds and 4 git commands to generate.