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_nogogit.go 663B

123456789101112131415161718192021222324
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. //go:build !gogit
  6. // +build !gogit
  7. package git
  8. // IsTagExist returns true if given tag exists in the repository.
  9. func (repo *Repository) IsTagExist(name string) bool {
  10. if name == "" {
  11. return false
  12. }
  13. return repo.IsReferenceExist(TagPrefix + name)
  14. }
  15. // GetTags returns all tags of the repository.
  16. func (repo *Repository) GetTags() (tags []string, err error) {
  17. tags, _, err = callShowRef(repo.Path, TagPrefix, "--tags", 0, 0)
  18. return
  19. }