gitweb: when showing history of a tree, show tree link not blob
[gitweb.git] / gitweb / gitweb.cgi
index 9569af09b5dd201a3f646071e6c82c01643d40d5..3cd4ce2a01e36b3e651769dcbff16776a0645f4b 100755 (executable)
@@ -779,9 +779,11 @@ sub mimetype_guess_file {
        open(MIME, $mimemap) or return undef;
        while (<MIME>) {
                my ($mime, $exts) = split(/\t+/);
-               my @exts = split(/\s+/, $exts);
-               foreach my $ext (@exts) {
-                       $mimemap{$ext} = $mime;
+               if (defined $exts) {
+                       my @exts = split(/\s+/, $exts);
+                       foreach my $ext (@exts) {
+                               $mimemap{$ext} = $mime;
+                       }
                }
        }
        close(MIME);
@@ -1433,7 +1435,7 @@ sub git_summary {
        my $headlist = git_read_refs("refs/heads");
        if (defined @$headlist) {
                git_header_div('heads');
-               git_heads_body($taglist, $head, 0, 15,
+               git_heads_body($headlist, $head, 0, 15,
                               $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=heads")}, "..."));
        }
 
@@ -2301,7 +2303,7 @@ sub git_history {
                              "<td class=\"link\">" .
                              $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit")}, "commit") .
                              " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$commit")}, "commitdiff") .
-                             " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;hb=$commit;f=$file_name")}, "blob");
+                             " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$ftype;hb=$commit;f=$file_name")}, $ftype);
                        my $blob = git_get_hash_by_path($hash_base, $file_name);
                        my $blob_parent = git_get_hash_by_path($commit, $file_name);
                        if (defined $blob && defined $blob_parent && $blob ne $blob_parent) {