allow branch names

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-13 23:29:27 -06:00
parent 6223ffe7bf
commit 0d49ed20ac
2 changed files with 19 additions and 3 deletions

View File

@ -24,7 +24,7 @@ func draw(rs *RepoStatus) {
rs.drawGitCommands() rs.drawGitCommands()
// figure out what the state of the git repository is // figure out what the state of the git repository is
rs.Update() // rs.Update()
} }
func (rs *RepoStatus) drawGitBranches() { func (rs *RepoStatus) drawGitBranches() {
@ -48,13 +48,15 @@ func (rs *RepoStatus) drawGitBranches() {
master = "main" master = "main"
} }
} }
rs.masterDrop.Set(master) // rs.masterDrop.Set(master)
// relabel the various gadgets with the right branch name // relabel the various gadgets with the right branch name
rs.masterBranchVersion.SetLabel(master) rs.masterBranchVersion.SetLabel(master)
rs.major.SetTitle(master) // rs.major.SetTitle(master)
/*
rs.develDrop.Set("devel") rs.develDrop.Set("devel")
rs.userDrop.Set("jcarr") rs.userDrop.Set("jcarr")
*/
var count *gui.Node var count *gui.Node

14
git.go
View File

@ -125,6 +125,20 @@ func (rs *RepoStatus) checkoutBranch(level string, branch string) {
} }
} }
func (rs *RepoStatus) SetMasterName(s string) {
rs.masterDrop.Set(s)
rs.masterBranchVersion.SetLabel(s)
// rs.major.SetTitle(s)
}
func (rs *RepoStatus) SetDevelName(s string) {
rs.develDrop.Set(s)
}
func (rs *RepoStatus) SetUserName(s string) {
rs.userDrop.Set(s)
}
// returns "master", "devel", os.Username, etc // returns "master", "devel", os.Username, etc
func (rs *RepoStatus) GetMasterName() string { func (rs *RepoStatus) GetMasterName() string {
name := rs.masterDrop.Get() name := rs.masterDrop.Get()