summaryrefslogtreecommitdiff
path: root/scanIterator.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-05 01:02:00 -0600
committerJeff Carr <[email protected]>2024-11-05 01:02:00 -0600
commit6601fae5716fef597d2ce76e99308b7ca755e10e (patch)
tree7cb29b2ecd3dfad08bbde8e1e05699a79f265fb4 /scanIterator.go
parent4fa21db5a956a3364ed994fde1bb7b457ebccb00 (diff)
adding tempWindow for merging
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'scanIterator.go')
-rw-r--r--scanIterator.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/scanIterator.go b/scanIterator.go
index 7f347b2..6ca2970 100644
--- a/scanIterator.go
+++ b/scanIterator.go
@@ -63,6 +63,16 @@ func (r *RepoList) ReposSortByName() *RepoIterator {
return iterator
}
+func (r *RepoList) UnmergedRepos() *RepoIterator {
+ repoPointers := r.selectRepoAll()
+
+ sort.Sort(ByName(repoPointers))
+
+ iterator := NewRepoIterator(repoPointers)
+
+ return iterator
+}
+
type ByName []*RepoRow
func (a ByName) Len() int { return len(a) }
@@ -92,3 +102,36 @@ func (r *RepoList) selectRepoAll() []*RepoRow {
return repoPointers
}
+
+// SelectRepoPointers safely returns a slice of pointers to Repo records.
+func (r *RepoList) selectUnmergedRepos() []*RepoRow {
+ r.RLock()
+ defer r.RUnlock()
+
+ // Create a new slice to hold pointers to each Repo
+ // repoPointers := make([]*Repo, len(c.E.Repos))
+ var repoPointers []*RepoRow
+ for _, repo := range me.allrepos {
+ if repo == nil {
+ continue
+ }
+ if repo.Status == nil {
+ continue
+ }
+ if !repo.Status.InitOk {
+ continue
+ }
+ if repo.ReadOnly() {
+ continue
+ }
+ if repo.State() == "PERFECT" {
+ continue
+ }
+ if repo.Status.IsReleased() {
+ continue
+ }
+ repoPointers = append(repoPointers, repo) // Copy pointers for safe iteration
+ }
+
+ return repoPointers
+}