summaryrefslogtreecommitdiff
path: root/gitweb/gitweb.perl
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2009-11-06 15:08:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-11-06 17:56:34 (GMT)
commitb9759f0762c17a5b7bc36af98613c67249931330 (patch)
tree591ceffce70a56e2ca1fe1b2718764a86d4fbc17 /gitweb/gitweb.perl
parent78d553b7d7b269bb22ebd8b1198657c37484a3a0 (diff)
downloadgit-b9759f0762c17a5b7bc36af98613c67249931330.zip
git-b9759f0762c17a5b7bc36af98613c67249931330.tar.gz
git-b9759f0762c17a5b7bc36af98613c67249931330.tar.bz2
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.perl')
-rwxr-xr-xgitweb/gitweb.perl3
1 files changed, 2 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 24b2193..184b683 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5065,7 +5065,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);
}
}