1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

Move git references checking to gitrepo packages to reduce expose of repository path (#33891)

This commit is contained in:
Lunny Xiao
2025-03-15 19:48:59 -07:00
committed by GitHub
parent f11ac6bf3c
commit 0056fdb942
24 changed files with 79 additions and 46 deletions

View File

@@ -5,7 +5,6 @@
package git
import (
"context"
"fmt"
"io"
"strings"
@@ -17,11 +16,6 @@ import (
// TagPrefix tags prefix path on the repository
const TagPrefix = "refs/tags/"
// IsTagExist returns true if given tag exists in the repository.
func IsTagExist(ctx context.Context, repoPath, name string) bool {
return IsReferenceExist(ctx, repoPath, TagPrefix+name)
}
// CreateTag create one tag in the repository
func (repo *Repository) CreateTag(name, revision string) error {
_, _, err := NewCommand("tag").AddDashesAndList(name, revision).RunStdString(repo.Ctx, &RunOpts{Dir: repo.Path})