index-pack: Don't follow replace refs.
[gitweb.git] / gitweb / gitweb.perl
index 9446376535b1790c2400cd5bbc1e12f1a8b8f7c9..6deec87e5d26b963902f80049ca0e34f76daa0bc 100755 (executable)
@@ -1027,18 +1027,18 @@ sub dispatch {
        $actions{$action}->();
 }
 
-sub run_request {
+sub reset_timer {
        our $t0 = [Time::HiRes::gettimeofday()]
                if defined $t0;
+       our $number_of_git_cmds = 0;
+}
+
+sub run_request {
+       reset_timer();
 
        evaluate_uri();
-       evaluate_gitweb_config();
-       evaluate_git_version();
        check_loadavg();
 
-       # $projectroot and $projects_list might be set in gitweb config file
-       $projects_list ||= $projectroot;
-
        evaluate_query_params();
        evaluate_path_info();
        evaluate_and_validate_params();
@@ -1086,6 +1086,11 @@ sub evaluate_argv {
 
 sub run {
        evaluate_argv();
+       evaluate_gitweb_config();
+       evaluate_git_version();
+
+       # $projectroot and $projects_list might be set in gitweb config file
+       $projects_list ||= $projectroot;
 
        $pre_listen_hook->()
                if $pre_listen_hook;
@@ -1322,8 +1327,7 @@ sub esc_param {
 sub esc_url {
        my $str = shift;
        return undef unless defined $str;
-       $str =~ s/([^A-Za-z0-9\-_.~();\/;?:@&=])/sprintf("%%%02X", ord($1))/eg;
-       $str =~ s/\+/%2B/g;
+       $str =~ s/([^A-Za-z0-9\-_.~();\/;?:@&= ]+)/CGI::escape($1)/eg;
        $str =~ s/ /\+/g;
        return $str;
 }
@@ -6518,12 +6522,13 @@ sub git_search {
                        $paging_nav .= " ⋅ next";
                }
 
-               if ($#commitlist >= 100) {
-               }
-
                git_print_page_nav('','', $hash,$co{'tree'},$hash, $paging_nav);
                git_print_header_div('commit', esc_html($co{'title'}), $hash);
-               git_search_grep_body(\@commitlist, 0, 99, $next_link);
+               if ($page == 0 && !@commitlist) {
+                       print "<p>No match.</p>\n";
+               } else {
+                       git_search_grep_body(\@commitlist, 0, 99, $next_link);
+               }
        }
 
        if ($searchtype eq 'pickaxe') {