aboutsummaryrefslogtreecommitdiffstats
path: root/modules/gitrepo/tag.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2025-03-15 19:48:59 -0700
committerGitHub <noreply@github.com>2025-03-15 19:48:59 -0700
commit0056fdb94201f54fcbb51d741a68b04bf41213fc (patch)
tree5185b6ad1d8c8560e8cb06cb83a60d6c8fc35620 /modules/gitrepo/tag.go
parentf11ac6bf3cb45e01080b1ec5bd9cbdd1ee5cda92 (diff)
downloadgitea-0056fdb94201f54fcbb51d741a68b04bf41213fc.tar.gz
gitea-0056fdb94201f54fcbb51d741a68b04bf41213fc.zip
Move git references checking to gitrepo packages to reduce expose of repository path (#33891)
Diffstat (limited to 'modules/gitrepo/tag.go')
-rw-r--r--modules/gitrepo/tag.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/gitrepo/tag.go b/modules/gitrepo/tag.go
new file mode 100644
index 0000000000..58ed204a99
--- /dev/null
+++ b/modules/gitrepo/tag.go
@@ -0,0 +1,15 @@
+// Copyright 2025 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package gitrepo
+
+import (
+ "context"
+
+ "code.gitea.io/gitea/modules/git"
+)
+
+// IsTagExist returns true if given tag exists in the repository.
+func IsTagExist(ctx context.Context, repo Repository, name string) bool {
+ return IsReferenceExist(ctx, repo, git.TagPrefix+name)
+}