summaryrefslogtreecommitdiff
path: root/reloadTags.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-18 10:34:58 -0600
committerJeff Carr <[email protected]>2025-01-18 10:34:58 -0600
commit0c30a9da2f9a30a9f41c755879ea5be266180ce0 (patch)
tree6cea2ef505f0cb92db890fd6a10f55f22f860c05 /reloadTags.go
parent80f602c4d91fa84cfbafd3787cf255d2832ed588 (diff)
parse .git/configv0.0.57
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
}