Add skip and limit to git.GetTags (#16897)

* Make GetTags() api similar to GetBranches()
* Use it for Tag/Release page
This commit is contained in:
6543 2021-09-10 19:30:37 +02:00 committed by GitHub
parent 9ca0e7905c
commit 77f604a928
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 20 deletions

View file

@ -606,7 +606,7 @@ func getBranchesAndTagsForRepo(user *models.User, repo *models.Repository) (bool
if err != nil {
return false, nil, nil, err
}
tags, err := gitRepo.GetTags()
tags, err := gitRepo.GetTags(0, 0)
if err != nil {
return false, nil, nil, err
}
@ -632,7 +632,7 @@ func CompareDiff(ctx *context.Context) {
}
baseGitRepo := ctx.Repo.GitRepo
baseTags, err := baseGitRepo.GetTags()
baseTags, err := baseGitRepo.GetTags(0, 0)
if err != nil {
ctx.ServerError("GetTags", err)
return
@ -646,7 +646,7 @@ func CompareDiff(ctx *context.Context) {
}
ctx.Data["HeadBranches"] = headBranches
headTags, err := headGitRepo.GetTags()
headTags, err := headGitRepo.GetTags(0, 0)
if err != nil {
ctx.ServerError("GetTags", err)
return