本站源代码
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.

25 lines
568B

  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/gitea/modules/git"
  7. )
  8. // GetTagsByPath returns repo tags by its 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. }
上海开阖软件有限公司 沪ICP备12045867号-1