forked from Gitlink/gitea-1156
fix: get tag use tagCount action
This commit is contained in:
parent
d12171ec72
commit
67a6b37966
|
@ -301,9 +301,9 @@ func BranchTagCount(ctx *context.APIContext) {
|
|||
// "200":
|
||||
// "$ref": "#/responses/RepoBranchAndTagCount"
|
||||
|
||||
tags, err := ctx.Repo.GitRepo.GetTagInfos(0, 0) // tags info
|
||||
tagsCount, err := ctx.Repo.GitRepo.GetTagCount() // tags info
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "GetTags", err)
|
||||
ctx.Error(http.StatusInternalServerError, "GetTagCount", err)
|
||||
return
|
||||
}
|
||||
repo := ctx.Repo.Repository
|
||||
|
@ -314,7 +314,7 @@ func BranchTagCount(ctx *context.APIContext) {
|
|||
}
|
||||
result := api.RepoBranchAndTagCount{
|
||||
BranchCount: countAll,
|
||||
TagCount: len(tags),
|
||||
TagCount: int(tagsCount),
|
||||
}
|
||||
ctx.JSON(http.StatusOK, result)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue