diff options
Diffstat (limited to 'routers/repo/commit.go')
-rw-r--r-- | routers/repo/commit.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go index e581d39526..cb9727fccc 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -58,8 +58,13 @@ func Commits(ctx *context.Context) { page = 1 } + pageSize := ctx.QueryInt("limit") + if pageSize <= 0 { + pageSize = git.CommitsRangeSize + } + // Both `git log branchName` and `git log commitId` work. - commits, err := ctx.Repo.Commit.CommitsByRange(page) + commits, err := ctx.Repo.Commit.CommitsByRange(page, pageSize) if err != nil { ctx.ServerError("CommitsByRange", err) return |