summaryrefslogtreecommitdiff
path: root/tagWindow.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-16 17:55:13 -0600
committerJeff Carr <[email protected]>2024-02-16 17:55:13 -0600
commit0b4f4d76866ccc500112cfe553240c47961258e2 (patch)
tree5b68ef32ea6dab46b0aa3c7c522f4852b62bfcd3 /tagWindow.go
parentbd62a89a670eab24ff5fd7b1ed155b89dde08157 (diff)
ready to work on creating branches
Diffstat (limited to 'tagWindow.go')
-rw-r--r--tagWindow.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/tagWindow.go b/tagWindow.go
index 80f14cf..f6a349d 100644
--- a/tagWindow.go
+++ b/tagWindow.go
@@ -1,6 +1,7 @@
package repostatus
import (
+ "path/filepath"
"regexp"
"slices"
"strings"
@@ -281,3 +282,33 @@ func (rt *repoTag) Show() {
rt.subject.Show()
rt.deleteB.Show()
}
+
+func (rs *RepoStatus) TagExists(findname string) bool {
+ allTags := rs.Tags.ListAll()
+ for _, t := range allTags {
+ tagname := t.TagString()
+ _, filename := filepath.Split(tagname)
+ if filename == findname {
+ // log.Info("found tag:", path, filename, "from", rs.Path())
+ return true
+ }
+ }
+ return false
+}
+
+func (rs *RepoStatus) LocalTagExists(findname string) bool {
+ allTags := rs.Tags.ListAll()
+ for _, t := range allTags {
+ tagname := t.TagString()
+ if strings.HasPrefix(tagname, "refs/remotes") {
+ continue
+ }
+ path, filename := filepath.Split(tagname)
+ log.Log(INFO, "tag:", path, filename, "from", rs.Path())
+ if filename == findname {
+ log.Log(INFO, "found tag:", path, filename, "from", rs.Path())
+ return true
+ }
+ }
+ return false
+}