diff options
| author | Jeff Carr <[email protected]> | 2025-01-30 11:02:37 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-30 11:02:37 -0600 |
| commit | b91475b55b93a87aabb63e661a46d85c28623eb9 (patch) | |
| tree | d9dd098e1ce66e47aa21fa6e41d61ee83658677b /scan.go | |
| parent | 8247d748bd26be6eb87a978573b0d435e83178a1 (diff) | |
Diffstat (limited to 'scan.go')
| -rw-r--r-- | scan.go | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -12,14 +12,14 @@ func (r *RepoList) RegisterHideFunction(f func(*RepoRow)) { me.hideFunction = f } -func (r *RepoList) ScanRepositories() (int, string) { +func (r *RepoList) ScanRepositoriesOld() (int, string) { var i int var shown int var total int t := TimeFunction(func() { for _, repo := range me.allrepos { i += 1 - changed := repo.NewScan() + changed := repo.Update() total += changed } var hidden int @@ -44,7 +44,7 @@ func (r *RepoRow) UpdatePb(newpb *gitpb.Repo) { r.pb = newpb } -func (r *RepoRow) NewScan() int { +func (r *RepoRow) Update() int { var changed int = 0 if r.Status == nil { log.Log(WARN, "repo.Status = nil. not initialized for some reason") @@ -61,7 +61,7 @@ func (r *RepoRow) NewScan() int { } // run the repostatus update - r.Status.Update() + // r.Status.Update() r.masterVersion.SetLabel(pb.GetMasterVersion()) r.develVersion.SetLabel(pb.GetDevelVersion()) @@ -70,6 +70,14 @@ func (r *RepoRow) NewScan() int { r.currentName.SetLabel(pb.GetCurrentBranchName()) r.currentVersion.SetLabel(pb.GetCurrentBranchVersion()) + // disable the commit button if the repo is not on the user branch + if pb.GetCurrentBranchName() == pb.GetUserBranchName() { + r.commitB.Enable() + } else { + r.commitB.Disable() + } + + // TODO: finally make this alot smarter if r.State() == "merge to main" { r.Hide() } |
