]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.cgi
gitweb: avoid undefined value warning in print_page_path
[Gitweb] / gitweb.cgi
index 59c3c7ebd510015058975127f9b013d959668b8fcedb2bd9fce15b7ddb1641f0..95262271d24801ccd946981f487e45dca6003c44794babe485bda08349d3676b 100755 (executable)
@@ -1035,7 +1035,7 @@ sub git_print_page_path {
 
        if (!defined $name) {
                print "<div class=\"page_path\"><b>/</b></div>\n";
-       } elsif ($type =~ "blob") {
+       } elsif (defined $type && $type eq 'blob') {
                print "<div class=\"page_path\"><b>" .
                        $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;f=$file_name")}, esc_html($name)) . "</b><br/></div>\n";
        } else {
@@ -1550,7 +1550,7 @@ sub git_blame {
                " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;f=$file_name")}, "head");
        git_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);
        git_header_div('commit', esc_html($co{'title'}), $hash_base);
-       git_print_page_path($file_name);
+       git_print_page_path($file_name, 'blob');
        print "<div class=\"page_body\">\n";
        print <<HTML;
 <table class="blame">
@@ -1773,7 +1773,7 @@ sub git_tree {
        if (defined $file_name) {
                $base = esc_html("$file_name/");
        }
-       git_print_page_path($file_name);
+       git_print_page_path($file_name, 'tree');
        print "<div class=\"page_body\">\n";
        print "<table cellspacing=\"0\">\n";
        my $alternate = 0;
@@ -2303,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) {
This page took 0.082973 seconds and 4 git commands to generate.