summaryrefslogtreecommitdiff
path: root/gitTag.common.go
diff options
context:
space:
mode:
Diffstat (limited to 'gitTag.common.go')
-rw-r--r--gitTag.common.go60
1 files changed, 30 insertions, 30 deletions
diff --git a/gitTag.common.go b/gitTag.common.go
index 66e45e9..f6e5d1f 100644
--- a/gitTag.common.go
+++ b/gitTag.common.go
@@ -11,8 +11,8 @@ func (repo *Repo) ActualDevelHash() string {
brname := repo.GetDevelBranchName()
refname := "refs/heads/" + brname
for tag := range repo.Tags.IterAll() {
- // log.Info("repo tag", tag.GetHash(), tag.GetRefname())
- if tag.GetRefname() == refname {
+ // log.Info("repo tag", tag.GetHash(), tag.GetName())
+ if tag.GetName() == refname {
return tag.GetHash()
}
}
@@ -37,8 +37,8 @@ func (repo *Repo) ActualGetMasterHash() (string, string) {
func (repo *Repo) GetLocalHash(brname string) string {
refname := "refs/heads/" + brname
for tag := range repo.Tags.IterAll() {
- // log.Info("repo tag", tag.GetHash(), tag.GetRefname())
- if tag.GetRefname() == refname {
+ // log.Info("repo tag", tag.GetHash(), tag.GetName())
+ if tag.GetName() == refname {
return strings.TrimSpace(tag.GetHash())
}
}
@@ -48,19 +48,19 @@ func (repo *Repo) GetLocalHash(brname string) string {
func (repo *Repo) GetRemoteHash(brname string) string {
refname := "refs/remotes/origin/" + brname
for tag := range repo.Tags.IterAll() {
- // log.Info("repo tag", tag.GetHash(), tag.GetRefname())
- if tag.GetRefname() == refname {
+ // log.Info("repo tag", tag.GetHash(), tag.GetName())
+ if tag.GetName() == refname {
return strings.TrimSpace(tag.GetHash())
}
}
return ""
}
-func (repo *Repo) GetRemoteTag(brname string) *GitTag {
+func (repo *Repo) GetRemoteTag(brname string) *Stat {
refname := "refs/remotes/origin/" + brname
for tag := range repo.Tags.IterAll() {
- // log.Info("repo tag", tag.GetHash(), tag.GetRefname())
- if tag.GetRefname() == refname {
+ // log.Info("repo tag", tag.GetHash(), tag.GetName())
+ if tag.GetName() == refname {
return tag
}
}
@@ -74,7 +74,7 @@ func (repo *Repo) IsBranchRemote(brname string) bool {
}
brname = "refs/remotes/origin/" + brname
- ref := repo.Tags.FindByRefname(brname)
+ ref := repo.Tags.FindByName(brname)
if ref == nil {
// log.Info("did not found refname!!!!!!!!", brname)
return false
@@ -98,7 +98,7 @@ func (repo *Repo) IsDevelRemote() bool {
// eventually this will be worked out by forge in some future code that hasn't been made yet
func (repo *Repo) IsBranch(findname string) bool {
for t := range repo.Tags.IterAll() {
- tagname := t.Refname
+ tagname := t.Name
if strings.HasPrefix(tagname, "refs/remotes") {
continue
}
@@ -113,12 +113,12 @@ func (repo *Repo) IsBranch(findname string) bool {
return false
}
-func (repo *Repo) IsBranchLocal(findname string) *GitTag {
+func (repo *Repo) IsBranchLocal(findname string) *Stat {
for t := range repo.Tags.IterAll() {
- if !strings.HasPrefix(t.Refname, "refs/heads") {
+ if !strings.HasPrefix(t.Name, "refs/heads") {
continue
}
- _, filename := filepath.Split(t.Refname)
+ _, filename := filepath.Split(t.Name)
// 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())
@@ -130,10 +130,10 @@ func (repo *Repo) IsBranchLocal(findname string) *GitTag {
func (repo *Repo) IsLocalBranch(findname string) bool {
for t := range repo.Tags.IterAll() {
- if !strings.HasPrefix(t.Refname, "refs/heads") {
+ if !strings.HasPrefix(t.Name, "refs/heads") {
continue
}
- path, filename := filepath.Split(t.Refname)
+ path, filename := filepath.Split(t.Name)
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())
@@ -146,10 +146,10 @@ func (repo *Repo) IsLocalBranch(findname string) bool {
func (repo *Repo) IsLocalBranchVerbose(findname string) bool {
for t := range repo.Tags.IterAll() {
- if !strings.HasPrefix(t.Refname, "refs/heads") {
+ if !strings.HasPrefix(t.Name, "refs/heads") {
continue
}
- path, filename := filepath.Split(t.Refname)
+ path, filename := filepath.Split(t.Name)
log.Info("gitpb.IsBranch() tag:", path, filename, "from", repo.GetGoPath())
if filename == findname {
log.Info("gitpb.IsBranch() found tag:", path, filename, "from", repo.GetGoPath())
@@ -162,10 +162,10 @@ func (repo *Repo) IsLocalBranchVerbose(findname string) bool {
func (repo *Repo) IsRemoteBranch(findname string) bool {
for t := range repo.Tags.IterAll() {
- if !strings.HasPrefix(t.Refname, "refs/remotes/origin") {
+ if !strings.HasPrefix(t.Name, "refs/remotes/origin") {
continue
}
- path, filename := filepath.Split(t.Refname)
+ path, filename := filepath.Split(t.Name)
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())
@@ -176,9 +176,9 @@ func (repo *Repo) IsRemoteBranch(findname string) bool {
return false
}
-func (repo *Repo) IfRefExists(refname string) *GitTag {
+func (repo *Repo) IfRefExists(refname string) *Stat {
for t := range repo.Tags.IterAll() {
- if _, filename := filepath.Split(t.Refname); filename == refname {
+ if _, filename := filepath.Split(t.Name); filename == refname {
return t
}
}
@@ -187,26 +187,26 @@ func (repo *Repo) IfRefExists(refname string) *GitTag {
// finds the newest tag. used for deciding if master needs to be published
func (repo *Repo) FindLastTag() string {
- var newest *GitTag
+ var newest *Stat
for tag := range repo.Tags.IterAll() {
- if !strings.HasPrefix(tag.GetRefname(), "refs/tags/") {
+ if !strings.HasPrefix(tag.GetName(), "refs/tags/") {
continue
}
if newest == nil {
newest = tag
continue
}
- cur := newest.Creatordate.AsTime()
- if cur.Before(tag.Creatordate.AsTime()) {
+ cur := newest.CommitTime.AsTime()
+ if cur.Before(tag.CommitTime.AsTime()) {
newest = tag
}
- // newtag := strings.TrimPrefix(tag.GetRefname(), "refs/tags/")
- // log.Info("repo tag", tag.GetHash(), tag.Creatordate.AsTime(), tag.GetRefname(), newtag)
+ // newtag := strings.TrimPrefix(tag.GetName(), "refs/tags/")
+ // log.Info("repo tag", tag.GetHash(), tag.CommitTime.AsTime(), tag.GetName(), newtag)
}
if newest == nil {
return ""
}
- // log.Info("repo newest tag", newest.GetHash(), newest.Creatordate.AsTime(), newest.GetRefname())
- newtag := strings.TrimPrefix(newest.GetRefname(), "refs/tags/")
+ // log.Info("repo newest tag", newest.GetHash(), newest.CommitTime.AsTime(), newest.GetName())
+ newtag := strings.TrimPrefix(newest.GetName(), "refs/tags/")
return newtag
}