From a43164877c68dfe92c848fe0f4dab4a16090ad5e Mon Sep 17 00:00:00 2001
From: Unknwon <joe2010xtmf@163.com>
Date: Tue, 25 Nov 2014 23:05:43 -0500
Subject: [PATCH] fix #664

---
 gogs.go                | 2 +-
 routers/repo/commit.go | 2 +-
 templates/.VERSION     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gogs.go b/gogs.go
index 2cecb58be..00ac2456e 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
 	"github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.5.8.1124 Beta"
+const APP_VER = "0.5.8.1125 Beta"
 
 func init() {
 	runtime.GOMAXPROCS(runtime.NumCPU())
diff --git a/routers/repo/commit.go b/routers/repo/commit.go
index 4a974aab8..1174e6266 100644
--- a/routers/repo/commit.go
+++ b/routers/repo/commit.go
@@ -62,7 +62,7 @@ func Commits(ctx *middleware.Context) {
 		lastPage = 0
 	}
 	nextPage := page + 1
-	if nextPage*50 > commitsCount {
+	if page*50 > commitsCount {
 		nextPage = 0
 	}
 
diff --git a/templates/.VERSION b/templates/.VERSION
index d4908c46c..d244b039e 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.5.8.1124 Beta
\ No newline at end of file
+0.5.8.1125 Beta
\ No newline at end of file