diff options
Diffstat (limited to 'tagWindow.go')
| -rw-r--r-- | tagWindow.go | 31 |
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 +} |
