1
1
mirror of https://github.com/go-gitea/gitea synced 2025-09-17 14:18:15 +00:00

Remove the duplicated function GetTags (#35375)

This PR removes the GetTags function from the git module and keeps only
GetTagInfos. All previous usages of GetTags have been replaced with
database-based tag functions.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Lunny Xiao
2025-08-28 18:11:42 -07:00
committed by GitHub
parent 09c3189ab7
commit aef4a3514c
5 changed files with 3 additions and 55 deletions

View File

@@ -707,12 +707,6 @@ func PrepareCompareDiff(
}
func getBranchesAndTagsForRepo(ctx gocontext.Context, repo *repo_model.Repository) (branches, tags []string, err error) {
gitRepo, err := gitrepo.OpenRepository(ctx, repo)
if err != nil {
return nil, nil, err
}
defer gitRepo.Close()
branches, err = git_model.FindBranchNames(ctx, git_model.FindBranchOptions{
RepoID: repo.ID,
ListOptions: db.ListOptionsAll,
@@ -721,7 +715,7 @@ func getBranchesAndTagsForRepo(ctx gocontext.Context, repo *repo_model.Repositor
if err != nil {
return nil, nil, err
}
tags, err = gitRepo.GetTags(0, 0)
tags, err = repo_model.GetTagNamesByRepoID(ctx, repo.ID)
if err != nil {
return nil, nil, err
}