summaryrefslogtreecommitdiff
path: root/gitTag.common.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-05 20:04:38 -0500
committerJeff Carr <[email protected]>2025-10-05 20:04:38 -0500
commitd9ed0838c403e982f572d108542bcc16705049d9 (patch)
tree5d8229be3dbfcd068219417cf0039e7e37735eca /gitTag.common.go
parent7360716b35b452595e93c554d5f342b9f0338ea2 (diff)
logic for branch testing
Diffstat (limited to 'gitTag.common.go')
-rw-r--r--gitTag.common.go28
1 files changed, 16 insertions, 12 deletions
diff --git a/gitTag.common.go b/gitTag.common.go
index 7535cd9..ac0f09c 100644
--- a/gitTag.common.go
+++ b/gitTag.common.go
@@ -85,19 +85,8 @@ func (repo *Repo) IsBranchRemote(brname string) bool {
// this is the correct way. uses 'git show-ref'
func (repo *Repo) IsDevelRemote() bool {
- if repo.Tags == nil {
- return false
- }
-
devname := repo.GetDevelBranchName()
- refname := "refs/remotes/origin/" + devname
- ref := repo.Tags.FindByRefname(refname)
- if ref == nil {
- // log.Info("did not found refname!!!!!!!!", refname)
- return false
- }
- // log.Info("found refname!!!!!!!!")
- return true
+ return repo.IsBranchRemote(devname)
}
// find a branch namm
@@ -124,6 +113,21 @@ func (repo *Repo) IsBranch(findname string) bool {
return false
}
+func (repo *Repo) IsBranchLocal(findname string) *GitTag {
+ for t := range repo.Tags.IterAll() {
+ if !strings.HasPrefix(t.Refname, "refs/heads") {
+ continue
+ }
+ path, filename := filepath.Split(t.Refname)
+ log.Log(INFO, "gitpb.IsBranch() tag:", path, filename, "from", repo.GetGoPath())
+ if filename == findname {
+ log.Log(INFO, "gitpb.IsBranch() found tag:", path, filename, "from", repo.GetGoPath())
+ return t
+ }
+ }
+ return nil
+}
+
func (repo *Repo) IsLocalBranch(findname string) bool {
for t := range repo.Tags.IterAll() {
if !strings.HasPrefix(t.Refname, "refs/heads") {