summaryrefslogtreecommitdiff
path: root/reloadTags.go
diff options
context:
space:
mode:
Diffstat (limited to 'reloadTags.go')
-rw-r--r--reloadTags.go33
1 files changed, 20 insertions, 13 deletions
diff --git a/reloadTags.go b/reloadTags.go
index eb4731e..3b574ac 100644
--- a/reloadTags.go
+++ b/reloadTags.go
@@ -135,21 +135,28 @@ func (repo *Repo) NewestTag() *GitTag {
return nil
}
+// this should just do is.Exists(".git/refs/heads/findname")
func (repo *Repo) LocalTagExists(findname string) bool {
- loop := repo.Tags.SortByRefname()
- for loop.Scan() {
- ref := loop.Next()
- // log.Info(repo.GoPath, ref.Refname)
- if strings.HasPrefix(ref.Refname, "refs/remotes") {
- continue
- }
- _, tagname := filepath.Split(ref.Refname)
- // log.Info("tag:", path, tagname, "from", repo.GoPath)
- if tagname == findname {
- // log.Info("found tag:", path, tagname, "from", repo.GoPath)
- return true
- }
+ fname := filepath.Join(".git/refs/heads", findname)
+ if repo.Exists(fname) {
+ return true
}
+ /*
+ loop := repo.Tags.SortByRefname()
+ for loop.Scan() {
+ ref := loop.Next()
+ // log.Info(repo.GoPath, ref.Refname)
+ if strings.HasPrefix(ref.Refname, "refs/remotes") {
+ continue
+ }
+ tagname := filepath.Base(ref.Refname)
+ // log.Info("tag:", path, tagname, "from", repo.GoPath)
+ if tagname == findname {
+ // log.Info("found tag:", path, tagname, "from", repo.GoPath)
+ return true
+ }
+ }
+ */
return false
}