diff options
author | Chester Liu <skyline75489@outlook.com> | 2021-01-19 12:07:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 05:07:38 +0100 |
commit | 0c0445c97a9219f7a9f7f2afd618b31bf958e14f (patch) | |
tree | fb8892bd34ac055f57887a26e1444f1dd919ef4c /modules/git/repo_commit.go | |
parent | 8d0e331c0abcda2a6da16c3eafecc98d38a8d4ae (diff) | |
download | gitea-0c0445c97a9219f7a9f7f2afd618b31bf958e14f.tar.gz gitea-0c0445c97a9219f7a9f7f2afd618b31bf958e14f.zip |
Add pager to the branches page (#14202)
* Add pager to the branches page
* override pageSize if bigger than max
* Make branches commit range configurable
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'modules/git/repo_commit.go')
-rw-r--r-- | modules/git/repo_commit.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go index c31f416628..f02fdde5a8 100644 --- a/modules/git/repo_commit.go +++ b/modules/git/repo_commit.go @@ -110,6 +110,9 @@ func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) { // CommitsRangeSize the default commits range size var CommitsRangeSize = 50 +// BranchesRangeSize the default branches range size +var BranchesRangeSize = 20 + func (repo *Repository) commitsByRange(id SHA1, page, pageSize int) (*list.List, error) { stdout, err := NewCommand("log", id.String(), "--skip="+strconv.Itoa((page-1)*pageSize), "--max-count="+strconv.Itoa(pageSize), prettyLogFormat).RunInDirBytes(repo.Path) |