summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-11 05:54:19 -0600
committerJeff Carr <[email protected]>2025-01-11 05:54:19 -0600
commitabdcd1fc623b58982723ee4db73f6179ff84a2a2 (patch)
treecaf4b74e3144d928d23896ee964fa93ef3aaee05
parentae8fd94a2c33f1bcfa56e009c4b88d82f0712c9d (diff)
updated to new protobuf filev0.22.38
-rw-r--r--applyPatch.go12
-rw-r--r--doConfig.go7
-rw-r--r--send.go8
3 files changed, 11 insertions, 16 deletions
diff --git a/applyPatch.go b/applyPatch.go
index 52713a9..8576add 100644
--- a/applyPatch.go
+++ b/applyPatch.go
@@ -13,7 +13,7 @@ import (
)
// returns bad if patches can not be applied
-func dumpPatchset(pset *forgepb.Patchs) bool {
+func dumpPatchset(pset *forgepb.Patchset) bool {
log.Info("applyPatches() NAME", pset.Name)
log.Info("applyPatches() COMMENT", pset.Comment)
log.Info("applyPatches() GIT_AUTHOR_NAME", pset.GetGitAuthorName())
@@ -85,7 +85,7 @@ func countCurrentPatches(repo *gitpb.Repo) int {
return len(result.Stdout)
}
-func applyPatchset(pset *forgepb.Patchs) error {
+func applyPatchset(pset *forgepb.Patchset) error {
var everythingworked bool = true
tmpdir, err := os.MkdirTemp("", "forge")
if err != nil {
@@ -132,7 +132,7 @@ func applyPatchset(pset *forgepb.Patchs) error {
return nil
}
-func readPatchFile(pbfile string) (*forgepb.Patchs, error) {
+func readPatchFile(pbfile string) (*forgepb.Patchset, error) {
bytes, err := os.ReadFile(pbfile)
if err != nil {
log.Info("readfile error", pbfile, err)
@@ -141,9 +141,9 @@ func readPatchFile(pbfile string) (*forgepb.Patchs, error) {
return handleBytes(bytes)
}
-func handleBytes(bytes []byte) (*forgepb.Patchs, error) {
- var pset *forgepb.Patchs
- pset = new(forgepb.Patchs)
+func handleBytes(bytes []byte) (*forgepb.Patchset, error) {
+ var pset *forgepb.Patchset
+ pset = new(forgepb.Patchset)
err := pset.Unmarshal(bytes)
if err != nil {
log.Info("Unmarshal failed", err)
diff --git a/doConfig.go b/doConfig.go
index cc2210e..0cf1dd9 100644
--- a/doConfig.go
+++ b/doConfig.go
@@ -43,12 +43,7 @@ func doConfig() {
UserBranchName: argv.Config.Add.User,
}
- if me.forge.Config.Append(&new1) {
- log.Info("added", new1.GoPath, "ok")
- } else {
- log.Info("added", new1.GoPath, "failed")
- os.Exit(-1)
- }
+ me.forge.Config.Append(&new1)
me.forge.ConfigSave()
os.Exit(0)
}
diff --git a/send.go b/send.go
index c6c9665..fff9ac4 100644
--- a/send.go
+++ b/send.go
@@ -12,7 +12,7 @@ import (
"go.wit.com/log"
)
-func sendPatches(pset *forgepb.Patchs) error {
+func sendPatches(pset *forgepb.Patchset) error {
var url string
url = me.urlbase + "/patchset"
msg, err := pset.Marshal()
@@ -91,7 +91,7 @@ func doRegister(newurl string) error {
return nil
}
-func getPatch(pbfile string) (*forgepb.Patchs, error) {
+func getPatch(pbfile string) (*forgepb.Patchset, error) {
url := me.urlbase + "/patchsetget?filename=" + pbfile
log.Info("getPatch() url", url)
body, err := httpPost(url, nil)
@@ -100,8 +100,8 @@ func getPatch(pbfile string) (*forgepb.Patchs, error) {
return nil, err
}
log.Info("getPatch() len(body)", len(body))
- var pset *forgepb.Patchs
- pset = new(forgepb.Patchs)
+ var pset *forgepb.Patchset
+ pset = new(forgepb.Patchset)
err = pset.Unmarshal(body)
if err != nil {
log.Info("Unmarshal failed", err)