summaryrefslogtreecommitdiff
path: root/doPatch.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-08 13:19:40 -0500
committerJeff Carr <[email protected]>2025-09-08 13:19:40 -0500
commit11bf5481c7cb393cf2d3416a9f64be078da27e85 (patch)
treec1137d44419384e2d65e0ee5eb66e00d7652676e /doPatch.go
parent66802a287f5bb773067df7a455242f93b0e565b0 (diff)
common patch submit codev0.22.152
Diffstat (limited to 'doPatch.go')
-rw-r--r--doPatch.go27
1 files changed, 16 insertions, 11 deletions
diff --git a/doPatch.go b/doPatch.go
index 36357b3..c1e301b 100644
--- a/doPatch.go
+++ b/doPatch.go
@@ -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 {