diff options
| author | Jeff Carr <[email protected]> | 2024-02-16 17:55:13 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-16 17:55:13 -0600 |
| commit | 0b4f4d76866ccc500112cfe553240c47961258e2 (patch) | |
| tree | 5b68ef32ea6dab46b0aa3c7c522f4852b62bfcd3 /tagWindow.go | |
| parent | bd62a89a670eab24ff5fd7b1ed155b89dde08157 (diff) | |
ready to work on creating branches
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 +} |
