diff options
| author | Jeff Carr <[email protected]> | 2024-01-25 01:30:01 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-25 01:30:01 -0600 |
| commit | 4beeb0bb137bf179064354fa6fc3be2c951bdef6 (patch) | |
| tree | a4a5109a9034cef43903628747b5875f5949843e /git.go | |
| parent | 21546ce2c002e1550754578b1083f0a9c6d0a77d (diff) | |
cleaning code for release versionsv0.13.2
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'git.go')
| -rw-r--r-- | git.go | 42 |
1 files changed, 33 insertions, 9 deletions
@@ -153,35 +153,59 @@ func (rs *RepoStatus) checkoutBranch(level string, branch string) { } func (rs *RepoStatus) SetMainWorkingName(s string) { + _, ok := rs.gitConfig.branches[s] + if ok { + log.Info("git branch", s, "seems to exist") + rs.mainWorkingName.SetValue(s) + return + } + s = "master" + _, ok = rs.gitConfig.branches[s] + if ok { + log.Info("git branch", s, "seems to exist") + rs.mainWorkingName.SetValue(s) + return + } + + s = "main" + _, ok = rs.gitConfig.branches[s] + if ok { + log.Info("git branch", s, "seems to exist") + rs.mainWorkingName.SetValue(s) + return + } + + s = "notsure" + log.Warn("git branch", s, "does not seem to exist. TODO: figure out the server default") + for name, _ := range rs.gitConfig.branches { + log.Warn("git branch found. use this?", name) + } rs.mainWorkingName.SetValue(s) - rs.masterDrop.SetLabel(s) - rs.masterDrop.SetText("guimaster") } func (rs *RepoStatus) SetDevelWorkingName(s string) { rs.develWorkingName.SetValue(s) rs.develBranchVersion.SetLabel(s) - rs.develDrop.SetLabel(s) - rs.develDrop.SetText(s) } func (rs *RepoStatus) SetUserWorkingName(s string) { rs.userWorkingName.SetValue(s) rs.userBranchVersion.SetLabel(s) - rs.userDrop.SetText(s) + // rs.userDrop.SetText(s) } // returns "master", "devel", os.Username, etc func (rs *RepoStatus) GetMasterBranchName() string { - name := rs.masterDrop.String() + name := rs.mainWorkingName.String() return name } func (rs *RepoStatus) GetDevelBranchName() string { - name := rs.develDrop.String() + name := rs.develWorkingName.String() return name } + func (rs *RepoStatus) GetUserBranchName() string { - name := rs.userDrop.String() + name := rs.userWorkingName.String() return name } @@ -223,7 +247,7 @@ func (rs *RepoStatus) SetUserVersion(s string) { } rs.changed = true rs.userBranchVersion.SetValue(s) - log.Verbose("git", rs.GetUserBranchName(), "is now version =", s) + // log.Verbose("git", rs.GetUserBranchName(), "is now version =", s) } func (rs *RepoStatus) GetStatus() string { |
