diff options
author | jaqra <48099350+jaqra@users.noreply.github.com> | 2019-10-15 00:38:35 +0300 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-10-14 22:38:35 +0100 |
commit | 086bfb8b4b655f46ac9471cbea9df70e912c315d (patch) | |
tree | f89c2f17afa05b622e644a81ae09c087d83452b3 /models/graph.go | |
parent | 30835226207f9a618bb2d4956fb209b1dbe099e6 (diff) | |
download | gitea-086bfb8b4b655f46ac9471cbea9df70e912c315d.tar.gz gitea-086bfb8b4b655f46ac9471cbea9df70e912c315d.zip |
Add pagination to commit graph page (#8360)
Fixes #8308
Diffstat (limited to 'models/graph.go')
-rw-r--r-- | models/graph.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/models/graph.go b/models/graph.go index 5f68abaf74..0efb51b3fc 100644 --- a/models/graph.go +++ b/models/graph.go @@ -30,7 +30,7 @@ type GraphItem struct { type GraphItems []GraphItem // GetCommitGraph return a list of commit (GraphItems) from all branches -func GetCommitGraph(r *git.Repository) (GraphItems, error) { +func GetCommitGraph(r *git.Repository, page int) (GraphItems, error) { var CommitGraph []GraphItem @@ -43,6 +43,7 @@ func GetCommitGraph(r *git.Repository) (GraphItems, error) { "-C", "-M", fmt.Sprintf("-n %d", setting.UI.GraphMaxCommitNum), + fmt.Sprintf("--skip=%d", setting.UI.GraphMaxCommitNum*(page-1)), "--date=iso", fmt.Sprintf("--pretty=format:%s", format), ) |