@matheusbsbs / matheus-bagliano / commits / 3550ea71f5
Fork 0

gitweb: use_pathinfo filenames start with /

Generate PATH_INFO URLs in the form project/action/hash_base:/filename rather than project/action/hash_base:filename (the latter form is still accepted in input). This minimal change allows relative navigation to work properly when viewing HTML files in raw ('blob_plain') mode. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Giuseppe Bilotta committed Oct 21, 2008 at 21:34 UTC 3550ea71f566b6958ffedf1573806d5fe891f344
1 file changed +3 -3
gitweb/gitweb.perl
+3 -3
@@ -734,7 +734,7 @@ sub href (%) {
734 # try to put as many parameters as possible in PATH_INFO:
735 # - project name
736 # - action
737 - # - hash or hash_base:filename
737 + # - hash or hash_base:/filename
738
739 # When the script is the root DirectoryIndex for the domain,
740 # $href here would be something like http://gitweb.example.com/
@@ -753,11 +753,11 @@ sub href (%) {
753 delete $params{'action'};
754 }
755
756 - # Finally, we put either hash_base:file_name or hash
756 + # Finally, we put either hash_base:/file_name or hash
757 if (defined $params{'hash_base'}) {
758 $href .= "/".esc_url($params{'hash_base'});
759 if (defined $params{'file_name'}) {
760 - $href .= ":".esc_url($params{'file_name'});
760 + $href .= ":/".esc_url($params{'file_name'});
761 delete $params{'file_name'};
762 }
763 delete $params{'hash'};