diff options
| author | Jeff Carr <[email protected]> | 2025-09-08 13:19:40 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-08 13:19:40 -0500 |
| commit | 11bf5481c7cb393cf2d3416a9f64be078da27e85 (patch) | |
| tree | c1137d44419384e2d65e0ee5eb66e00d7652676e /doPatch.go | |
| parent | 66802a287f5bb773067df7a455242f93b0e565b0 (diff) | |
common patch submit codev0.22.152
Diffstat (limited to 'doPatch.go')
| -rw-r--r-- | doPatch.go | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -31,31 +31,36 @@ func isPatchingSafe() bool { if me.forge.Config.Mode == forgepb.ForgeMode_NORMAL { return true } - log.Info("forge requres a 'normal' state to work with patches") - log.Info("you must run:") + log.Info("This patch command is not safe to run now") + log.Info("you must reset the state of your git repositories. Run:") log.Info("") log.Info("forge normal") log.Info("") return false } +// submit's current working patches +func doPatchSubmit() error { + pset, err := me.forge.MakeDevelPatchSet("testing") + if err != nil { + return err + } + _, _, err = pset.Patches.HttpPostVerbose(myServer(), "new") + return err +} + func doPatch() error { if argv.Patch.Repos != nil { dumpDirtyRepos() return nil } - if !isPatchingSafe() { - return log.Errorf("not safe to work on patches") + if argv.Patch.Submit != nil { + return doPatchSubmit() } - if argv.Patch.Submit != nil { - pset, err := me.forge.MakeDevelPatchSet("testing") - if err != nil { - return err - } - pset.Patches.HttpPostVerbose(myServer(), "new") - return nil + if !isPatchingSafe() { + return log.Errorf("not safe to work on patches") } if argv.Patch.Get != nil { |
