From: Junio C Hamano Date: Mon, 16 Nov 2009 07:07:38 +0000 (-0800) Subject: Merge branch 'pb/maint-gitweb-blob-lineno' into maint X-Git-Tag: v1.6.5.3~6 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/3ad12436a0d21f3379d936027caeca6ac73f24fa?ds=inline;hp=-c Merge branch 'pb/maint-gitweb-blob-lineno' into maint * pb/maint-gitweb-blob-lineno: gitweb: Fix blob linenr links in pathinfo mode --- 3ad12436a0d21f3379d936027caeca6ac73f24fa diff --combined gitweb/gitweb.perl index 59dca7d3ad,184b683aa5..c77cd0341d --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@@ -1083,7 -1083,8 +1083,7 @@@ sub to_utf8 # correct, but quoted slashes look too horrible in bookmarks sub esc_param { my $str = shift; - $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; } @@@ -5064,7 -5065,8 +5064,8 @@@ sub git_blob chomp $line; $nr++; $line = untabify($line); - printf "
%4i %s
\n", + printf "
1) + . "#l%i\" class=\"linenr\">%4i %s
\n", $nr, $nr, $nr, esc_html($line, -nbsp=>1); } } @@@ -5327,7 -5329,7 +5328,7 @@@ sub git_commit } @$parents ) . ')'; } - if (gitweb_check_feature('patches')) { + if (gitweb_check_feature('patches') && @$parents <= 1) { $formats_nav .= " | " . $cgi->a({-href => href(action=>"patch", -replay=>1)}, "patch"); @@@ -5615,7 -5617,7 +5616,7 @@@ sub git_commitdiff $formats_nav = $cgi->a({-href => href(action=>"commitdiff_plain", -replay=>1)}, "raw"); - if ($patch_max) { + if ($patch_max && @{$co{'parents'}} <= 1) { $formats_nav .= " | " . $cgi->a({-href => href(action=>"patch", -replay=>1)}, "patch"); @@@ -5823,7 -5825,7 +5824,7 @@@ sub git_commitdiff_plain # format-patch-style patches sub git_patch { - git_commitdiff(-format => 'patch', -single=> 1); + git_commitdiff(-format => 'patch', -single => 1); } sub git_patches {