common code moved to forgepb

This commit is contained in:
Jeff Carr 2025-09-03 19:06:08 -05:00
parent e896cae995
commit 6f4ec05ccb
9 changed files with 10 additions and 22 deletions

View File

@ -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 {

View File

@ -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())

View File

@ -14,7 +14,7 @@ import (
func doDirty() {
doCheckDirtyAndConfigSave()
found := findDirty()
found := me.forge.FindDirty()
if found.Len() == 0 {
return
}

View File

@ -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() {

View File

@ -49,7 +49,7 @@ func debug() {
}
doCheckDirtyAndConfigSave()
found := findDirty()
found := me.forge.FindDirty()
dirty := found.Len()
if me.repoDirtyB != nil {

View File

@ -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 {

View File

@ -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() {

View File

@ -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)
})

View File

@ -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)