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 Xiaoandwxiaoguang authored and GitHub committed 2025-08-29 01:11:42 +00:00
1 parent 09c3189ab7
commit aef4a3514c
5 files changed
+3 -55

No files matched your search

+1 -7
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
}