diff options
author | Unknwon <u@gogs.io> | 2017-02-18 18:37:47 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-02-18 18:37:47 -0500 |
commit | c69900325d3b2d5eb7584512547fdc567bf6df91 (patch) | |
tree | 3e276a812d99eff360afe4ed614ad28cfad2c5c9 /vendor/github.com/gogits/git-module/commit.go | |
parent | 685737b8168ea4cf23410d5adf83fcb0ed581467 (diff) |
commits: able to specify pageSize dynamically (#3965)
Usage: <url>?page={page}&pageSize={pageSize}
Also avoid/removed getting total commits count for pagination,
users are only allowed navigation by 'newer' and 'older'.
Diffstat (limited to 'vendor/github.com/gogits/git-module/commit.go')
-rw-r--r-- | vendor/github.com/gogits/git-module/commit.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vendor/github.com/gogits/git-module/commit.go b/vendor/github.com/gogits/git-module/commit.go index d9a7b582..b68a6b97 100644 --- a/vendor/github.com/gogits/git-module/commit.go +++ b/vendor/github.com/gogits/git-module/commit.go @@ -170,8 +170,12 @@ func (c *Commit) CommitsCount() (int64, error) { return CommitsCount(c.repo.Path, c.ID.String()) } +func (c *Commit) CommitsByRangeSize(page, size int) (*list.List, error) { + return c.repo.CommitsByRangeSize(c.ID.String(), page, size) +} + func (c *Commit) CommitsByRange(page int) (*list.List, error) { - return c.repo.commitsByRange(c.ID, page) + return c.repo.CommitsByRange(c.ID.String(), page) } func (c *Commit) CommitsBefore() (*list.List, error) { |