diff options
| author | Jeff Carr <[email protected]> | 2024-02-19 16:29:10 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-19 16:29:10 -0600 |
| commit | ae7e9ba42c44687db038cacf7e0ae845e497f6e0 (patch) | |
| tree | fe79e556726dd89e9aa21a2fb245b1d5c53579e8 /git.go | |
| parent | ad21d5d5db43b975e88067ff730691e89e10ea97 (diff) | |
allow more fields to be mirrored
Diffstat (limited to 'git.go')
| -rw-r--r-- | git.go | 30 |
1 files changed, 24 insertions, 6 deletions
@@ -408,28 +408,46 @@ func (rs *RepoStatus) setUserVersion(s string) { rs.userBranchVersion.SetValue(s) } +func (rs *RepoStatus) GitState() string { + return rs.gitState.String() +} + +func (rs *RepoStatus) CheckGitState() string { + rs.setState() + return rs.gitState.String() +} + func (rs *RepoStatus) GetStatus() string { + return rs.gitState.String() +} + +func (rs *RepoStatus) setState() { rs.changed = false if rs.CheckDirty() { log.Log(INFO, "CheckDirty() true") - return "dirty" + rs.gitState.SetText("dirty") + return } if rs.GetUserVersion() != rs.GetDevelVersion() { - return "merge to devel" + rs.gitState.SetText("merge to devel") + return } if rs.GetDevelVersion() != rs.GetMasterVersion() { - return "merge to main" + rs.gitState.SetText("merge to main") + return } if rs.lasttag.String() != rs.GetMasterVersion() { - return "unchanged" + rs.gitState.SetText("unchanged") + return } if rs.CheckBranches() { log.Log(INFO, "Branches are Perfect") - return "PERFECT" + rs.gitState.SetText("PERFECT") + return } log.Log(INFO, rs.String(), "Branches are not Perfect") - return "unknown branches" + rs.gitState.SetText("unknown branches") } // TODO: make this report the error somewhere |
