mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-03 00:59:35 +00:00
refactor: make git package handle all git operations (#38543)
before: gitrepo vs git packages after: git package fully handle all git operations by the way, use `WithRepo(repo)` instead of `WithDir(repo.Path)` to hide path details. benefits: 1. remove all unnecessary wrappers, developers no need to struggle with "which package should be used" 2. simplify code, RepositoryFacade can (will) be used everywhere, all "path" details are (will be) hidden
This commit is contained in:
@@ -5,6 +5,7 @@ package git
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"sort"
|
||||
|
||||
"gitea.dev/modules/util"
|
||||
@@ -114,3 +115,8 @@ func sortTagsByTime(tags []*Tag) {
|
||||
sorter := tagSorter(tags)
|
||||
sort.Sort(sorter)
|
||||
}
|
||||
|
||||
// IsTagExist returns true if given tag exists in the repository.
|
||||
func IsTagExist(ctx context.Context, repo RepositoryFacade, name string) bool {
|
||||
return IsReferenceExist(ctx, repo, TagPrefix+name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user