Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorLea Wiemann <lewiemann@gmail.com>2008-05-28 03:25:42 +0400
committerJunio C Hamano <gitster@pobox.com>2008-05-28 09:27:30 +0400
commit1f684dc01c6a45341e8e47d8393f0ef66fdfc398 (patch)
tree411b46b2e4e9918790e3c35f550461a21c4e429d /gitweb
parenta17171b473e0073f73b429abdf348de92394d6a6 (diff)
gitweb: only display "next" links in logs if there is a next page
There was a bug in the implementation of the "next" links in format_paging_nav (for log and shortlog), which caused the next links to always be displayed, even if there is no next page. This fixes it. Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl8
1 files changed, 4 insertions, 4 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 12843a4846..345acf4520 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2676,7 +2676,7 @@ sub git_print_page_nav {
}
sub format_paging_nav {
- my ($action, $hash, $head, $page, $nrevs) = @_;
+ my ($action, $hash, $head, $page, $has_next_link) = @_;
my $paging_nav;
@@ -2694,7 +2694,7 @@ sub format_paging_nav {
$paging_nav .= " &sdot; prev";
}
- if ($nrevs >= (100 * ($page+1)-1)) {
+ if ($has_next_link) {
$paging_nav .= " &sdot; " .
$cgi->a({-href => href(-replay=>1, page=>$page+1),
-accesskey => "n", -title => "Alt-n"}, "next");
@@ -4585,7 +4585,7 @@ sub git_log {
my @commitlist = parse_commits($hash, 101, (100 * $page));
- my $paging_nav = format_paging_nav('log', $hash, $head, $page, (100 * ($page+1)));
+ my $paging_nav = format_paging_nav('log', $hash, $head, $page, $#commitlist >= 100);
git_header_html();
git_print_page_nav('log','', $hash,undef,undef, $paging_nav);
@@ -5505,7 +5505,7 @@ sub git_shortlog {
my @commitlist = parse_commits($hash, 101, (100 * $page));
- my $paging_nav = format_paging_nav('shortlog', $hash, $head, $page, (100 * ($page+1)));
+ my $paging_nav = format_paging_nav('shortlog', $hash, $head, $page, $#commitlist >= 100);
my $next_link = '';
if ($#commitlist >= 100) {
$next_link =