diff options
| author | Jeff Carr <[email protected]> | 2025-09-03 19:06:08 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-03 19:06:08 -0500 |
| commit | 6f4ec05ccb6875aa23e3601c18973ac1759fb456 (patch) | |
| tree | ca3e484177c2283588575451dd8915a0e57f039e | |
| parent | e896cae995a1d0be5f172bf856b732b5fbf14017 (diff) | |
common code moved to forgepb
| -rw-r--r-- | applyPatch.go | 2 | ||||
| -rw-r--r-- | doCommit.go | 2 | ||||
| -rw-r--r-- | doDirty.go | 2 | ||||
| -rw-r--r-- | doFind.go | 16 | ||||
| -rw-r--r-- | doGui.go | 2 | ||||
| -rw-r--r-- | doPull.go | 2 | ||||
| -rw-r--r-- | windowFound.go | 2 | ||||
| -rw-r--r-- | windowReposFix.go | 2 | ||||
| -rw-r--r-- | windowReposNew.go | 2 |
9 files changed, 10 insertions, 22 deletions
diff --git a/applyPatch.go b/applyPatch.go index f142733..223a2d9 100644 --- a/applyPatch.go +++ b/applyPatch.go @@ -48,7 +48,7 @@ func savePatchset(pset *forgepb.Patchset) error { // re-run git CheckDirty() on everything func IsAnythingDirty() bool { doCheckDirtyAndConfigSave() - found := findDirty() + found := me.forge.FindDirty() if found.Len() == 0 { return false } else { diff --git a/doCommit.go b/doCommit.go index f6fb8d1..ef379a2 100644 --- a/doCommit.go +++ b/doCommit.go @@ -14,7 +14,7 @@ import ( func doCommit() { if argv.All { doCheckDirtyAndConfigSave() - found := findDirty() + found := me.forge.FindDirty() var newpatches bool for repo := range found.IterAll() { log.Info("do a commit on repo", repo.GetGoPath()) @@ -14,7 +14,7 @@ import ( func doDirty() { doCheckDirtyAndConfigSave() - found := findDirty() + found := me.forge.FindDirty() if found.Len() == 0 { return } @@ -24,7 +24,7 @@ func doFind() *gitpb.Repos { } if argv.List.Dirty { - return findDirty() + return me.forge.FindDirty() } return findAll() @@ -52,7 +52,7 @@ func (f *FindCmd) findRepos() *gitpb.Repos { } if f.Dirty { - return findDirty() + return me.forge.FindDirty() } if f.User { @@ -101,18 +101,6 @@ func findFavorites() *gitpb.Repos { return found } -// finds repos that git is reporting as dirty -func findDirty() *gitpb.Repos { - found := gitpb.NewRepos() - - for repo := range me.forge.Repos.IterByFullPath() { - if repo.IsDirty() { - found.AppendByFullPath(repo) - } - } - return found -} - func findAll() *gitpb.Repos { found := gitpb.NewRepos() for repo := range me.forge.Repos.IterByFullPath() { @@ -49,7 +49,7 @@ func debug() { } doCheckDirtyAndConfigSave() - found := findDirty() + found := me.forge.FindDirty() dirty := found.Len() if me.repoDirtyB != nil { @@ -64,7 +64,7 @@ func doGitPullNew() error { check := gitpb.NewRepos() if argv.Pull.Dirty != nil { - check = findDirty() + check = me.forge.FindDirty() } if argv.Pull.Patches != nil { diff --git a/windowFound.go b/windowFound.go index a5d838c..06c530f 100644 --- a/windowFound.go +++ b/windowFound.go @@ -62,7 +62,7 @@ func (r *foundWindow) initWindow() { group1 := r.stack.NewGroup("Repo Summary") group1.NewButton("dirty", func() { log.Info("find dirty here") - found := findDirty() + found := me.forge.FindDirty() me.forge.PrintHumanTable(found) }) group1.NewButton("all", func() { diff --git a/windowReposFix.go b/windowReposFix.go index 9fa38f1..64ea40f 100644 --- a/windowReposFix.go +++ b/windowReposFix.go @@ -255,7 +255,7 @@ func makeHackModeWindow(stdwin *stdReposTableWin) { grid.NewButton("show dirty repos on win.Bottom", func() { log.Info("try to show dirty repos on bottom") - found := findDirty() + found := me.forge.FindDirty() stdwin.doReposTable(found) }) diff --git a/windowReposNew.go b/windowReposNew.go index 3651d82..eea3a02 100644 --- a/windowReposNew.go +++ b/windowReposNew.go @@ -53,7 +53,7 @@ func makeReposWinNew() *gadgets.GenericWindow { t.Delete() t = nil } - found := findDirty() + found := me.forge.FindDirty() // display the protobuf t = addWindowPB(insertWin, found) |
