You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

repo_tag.go 555B

123456789101112131415161718192021222324
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. import (
  6. "code.gitea.io/git"
  7. )
  8. // GetTagsByPath returns repo tags by it's path
  9. func GetTagsByPath(path string) ([]*git.Tag, error) {
  10. gitRepo, err := git.OpenRepository(path)
  11. if err != nil {
  12. return nil, err
  13. }
  14. return gitRepo.GetTagInfos()
  15. }
  16. // GetTags return repo's tags
  17. func (repo *Repository) GetTags() ([]*git.Tag, error) {
  18. return GetTagsByPath(repo.RepoPath())
  19. }