From 8202a75eea8ebcca23d88a5754ace45b3f7f4027 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 4 Sep 2025 19:17:58 -0500 Subject: [PATCH] cleaned up init.go more perfectly --- init.go | 18 ++++-------------- patchset.Get.go | 16 +--------------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/init.go b/init.go index 3806352..93104ee 100644 --- a/init.go +++ b/init.go @@ -96,6 +96,9 @@ func (f *Forge) InitPB() { f.hasFullScan = true } + // init the Patchsets + f.Patchsets = NewPatchsets() + // todo: play with these / determine good values based on user's machine f.rillX = 10 f.rillY = 20 @@ -139,20 +142,7 @@ func RawInitPB() *Forge { } func (f *Forge) RawInitPB() { - f.setenv() - - // load the ~/.config/forge/ config - f.Config = new(ForgeConfigs) - if err := f.Config.ConfigLoad(f.configDir); err != nil { - log.Log(WARN, "forgepb.ConfigLoad() failed", err) - } - - f.Repos = gitpb.NewRepos() - f.Repos.ConfigLoad() - - // todo: play with these / determine good values based on user's machine - f.rillX = 10 - f.rillY = 20 + f.InitPB() } // the first thing done is process any ENV settings diff --git a/patchset.Get.go b/patchset.Get.go index d287898..5570b87 100644 --- a/patchset.Get.go +++ b/patchset.Get.go @@ -8,13 +8,6 @@ import ( // retrieves current patches from forge func (f *Forge) GetPatches() error { - /* - defer func() { - if r := recover(); r != nil { - log.Warn("PANIC ecovered in loadUpstream()", r) - } - }() - */ url := f.forgeURL + "GetPatchsets" log.Info("GetPatchsets() url", url) body, err := f.HttpPost(url, nil) @@ -36,15 +29,8 @@ func (f *Forge) GetPatches() error { } func (f *Forge) loadUpstreamPatchsets(psets *Patchsets) { - /* - defer func() { - if r := recover(); r != nil { - log.Warn("PANIC ecovered in loadUpstream()", r) - } - }() - */ - var foundnew bool + all := psets.All() for all.Scan() { pset := all.Next()