diff options
Diffstat (limited to 'applyPatch.go')
| -rw-r--r-- | applyPatch.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/applyPatch.go b/applyPatch.go index 5ad452d..a7c891e 100644 --- a/applyPatch.go +++ b/applyPatch.go @@ -5,6 +5,7 @@ package main import ( "os" "path/filepath" + "strings" "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" @@ -209,3 +210,20 @@ func handleBytes(bytes []byte) (*forgepb.Patchset, error) { } return pset, nil } + +func doRegister(newurl string) error { + var url string + url = me.urlbase + "/register?url=" + newurl + body, err := me.forge.HttpPost(url, nil) + if err != nil { + log.Info("httpPost() failed:", err) + return err + } + + test := strings.TrimSpace(string(body)) + for _, line := range strings.Split(test, "\n") { + line = strings.TrimSpace(line) + log.Info("server returned:", line) + } + return nil +} |
