[PATCH] gitweb: Fix blob linenr links in pathinfo modet/blob/pathinfo
authorPetr Baudis <pasky@ucw.cz>
Fri, 6 Nov 2009 14:29:08 +0000 (6 15:29 +0100)
committerPetr Baudis <pasky@rover.dkm.cz>
Fri, 6 Nov 2009 14:29:08 +0000 (6 15:29 +0100)
.topdeps [new file with mode: 0644]
.topmsg [new file with mode: 0644]
gitweb/gitweb.perl

diff --git a/.topdeps b/.topdeps
new file mode 100644 (file)
index 0000000..43b8c65
--- /dev/null
+++ b/.topdeps
@@ -0,0 +1 @@
+vanilla/master
diff --git a/.topmsg b/.topmsg
new file mode 100644 (file)
index 0000000..b8d156d
--- /dev/null
+++ b/.topmsg
@@ -0,0 +1,10 @@
+From: Petr Baudis <pasky@suse.cz>
+Subject: [PATCH] gitweb: Fix blob linenr links in pathinfo mode
+
+In pathinfo mode, we use <base href> that refers to the base location
+of gitweb in order for various external media links to work well.
+However, this means that for the page to refer to itself, it must
+regenerate full link, and this is exactly what the blob view page
+did not do for line numbers.
+
+Signed-off-by: Petr Baudis <pasky@suse.cz>
index e4cbfc3..62325ea 100755 (executable)
@@ -5127,7 +5127,8 @@ sub git_blob {
                        chomp $line;
                        $nr++;
                        $line = untabify($line);
-                       printf "<div class=\"pre\"><a id=\"l%i\" href=\"#l%i\" class=\"linenr\">%4i</a> %s</div>\n",
+                       printf "<div class=\"pre\"><a id=\"l%i\" href=\"" . href(-replay => 1)
+                               . "#l%i\" class=\"linenr\">%4i</a> %s</div>\n",
                               $nr, $nr, $nr, esc_html($line, -nbsp=>1);
                }
        }