diff options
Diffstat (limited to 'update.go')
| -rw-r--r-- | update.go | 32 |
1 files changed, 9 insertions, 23 deletions
@@ -11,7 +11,7 @@ import ( func (rs *RepoStatus) gitBranchAll() { r := rs.Run([]string{"git", "branch", "--all"}) if r.Error != nil { - log.Log(WARN, "git branch failed string =", rs.String()) + log.Log(WARN, "git branch failed string =", rs.Path()) log.Log(WARN, "git branch failed realpath =", rs.realPath.String()) return } @@ -27,6 +27,8 @@ func (rs *RepoStatus) updateNew() { return } + pb := rs.pb + // store the current checked out branch name and version rs.checkCurrentBranchName() rs.checkCurrentBranchVersion() @@ -35,33 +37,17 @@ func (rs *RepoStatus) updateNew() { rs.populateTags() // record if the repo is dirty - rs.CheckDirty() + pb.CheckDirty() // store the last tag version rs.setLastTagVersion() // store the master branch version - mName := rs.GetMasterBranchName() - out, _ := rs.gitDescribeByName(mName) - rs.setMasterVersion(out) - - // store the devel branch version - dName := rs.GetDevelBranchName() - if dName == "" { - rs.setDevelVersion("") - } else { - out, _ = rs.gitDescribeByName(dName) - rs.setDevelVersion(out) - } + ver := pb.GetMasterVersion() + rs.mainBranchVersion.SetValue(ver) - // store the user branch version - uName := rs.GetUserBranchName() - if uName == "" { - rs.setUserVersion("") - } else { - out, _ = rs.gitDescribeByName(uName) - rs.setUserVersion(out) - } + rs.develBranchVersion.SetValue(pb.GetDevelVersion()) + rs.userBranchVersion.SetValue(pb.GetUserVersion()) // populates a string into the rs.gitState widget // todo: make the values from this function a bit cleaner @@ -151,7 +137,7 @@ func (rs *RepoStatus) EnableSelectTag() { // force there to be a commit message rs.releaseVersion.Disable() } else { - rs.generateCmd() + // rs.generateCmd() rs.releaseVersion.Enable() } } |
