more removal of old code
This commit is contained in:
parent
fcb74ce2e8
commit
a15d447fbd
28
git.go
28
git.go
|
@ -89,20 +89,6 @@ func (rs *RepoStatus) gitDescribeByName(name string) (string, error) {
|
||||||
return strings.TrimSpace(output), r.Error
|
return strings.TrimSpace(output), r.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: don't run git every time?
|
|
||||||
func (rs *RepoStatus) checkCurrentBranchVersion() string {
|
|
||||||
out := rs.pb.GetCurrentVersion()
|
|
||||||
rs.currentVersion.SetValue(out)
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
// this should get the most recent tag
|
|
||||||
func (rs *RepoStatus) setLastTagVersion() {
|
|
||||||
name := rs.pb.GetLastTagVersion()
|
|
||||||
rs.lasttag.SetText(name)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rs *RepoStatus) populateTags() {
|
func (rs *RepoStatus) populateTags() {
|
||||||
tmp := rs.realPath.String() + "/.git/refs/tags"
|
tmp := rs.realPath.String() + "/.git/refs/tags"
|
||||||
log.Log(REPO, "populateTags() path =", tmp)
|
log.Log(REPO, "populateTags() path =", tmp)
|
||||||
|
@ -115,17 +101,3 @@ func (rs *RepoStatus) populateTags() {
|
||||||
}
|
}
|
||||||
// rs.tagsDrop.SetText(rs.lasttagrev)
|
// rs.tagsDrop.SetText(rs.lasttagrev)
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns quickly based on the last time it was checked
|
|
||||||
func (rs *RepoStatus) IsDirty() bool {
|
|
||||||
return rs.pb.IsDirty()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rs *RepoStatus) CheckDirty() bool {
|
|
||||||
if rs.pb.IsDirty() {
|
|
||||||
rs.dirtyLabel.SetValue("dirty")
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
rs.dirtyLabel.SetValue("")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ func (rs *RepoStatus) drawGitCommands(box *gui.Node) {
|
||||||
})
|
})
|
||||||
|
|
||||||
newgrid.NewButton("CheckDirty()", func() {
|
newgrid.NewButton("CheckDirty()", func() {
|
||||||
if rs.CheckDirty() {
|
if rs.pb.CheckDirty() {
|
||||||
log.Log(WARN, "is dirty")
|
log.Log(WARN, "is dirty")
|
||||||
} else {
|
} else {
|
||||||
log.Log(WARN, "is not dirty")
|
log.Log(WARN, "is not dirty")
|
||||||
|
|
|
@ -17,7 +17,8 @@ func (rs *RepoStatus) Update() {
|
||||||
|
|
||||||
// store the current checked out branch name and version
|
// store the current checked out branch name and version
|
||||||
rs.checkCurrentBranchName()
|
rs.checkCurrentBranchName()
|
||||||
rs.checkCurrentBranchVersion()
|
out := rs.pb.GetCurrentVersion()
|
||||||
|
rs.currentVersion.SetValue(out)
|
||||||
|
|
||||||
// read in the tags
|
// read in the tags
|
||||||
rs.populateTags()
|
rs.populateTags()
|
||||||
|
@ -25,8 +26,9 @@ func (rs *RepoStatus) Update() {
|
||||||
// record if the repo is dirty
|
// record if the repo is dirty
|
||||||
pb.CheckDirty()
|
pb.CheckDirty()
|
||||||
|
|
||||||
// store the last tag version
|
// display the last tag version
|
||||||
rs.setLastTagVersion()
|
name := rs.pb.GetLastTagVersion()
|
||||||
|
rs.lasttag.SetText(name)
|
||||||
|
|
||||||
// store the master branch version
|
// store the master branch version
|
||||||
ver := pb.GetMasterVersion()
|
ver := pb.GetMasterVersion()
|
||||||
|
|
Loading…
Reference in New Issue