diff options
Diffstat (limited to 'gitTag.common.go')
| -rw-r--r-- | gitTag.common.go | 28 |
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") { |
