.proto changes

This commit is contained in:
Jeff Carr 2025-01-13 08:11:56 -06:00
parent 73ef74d479
commit 7fa4889dce
1 changed files with 7 additions and 7 deletions

View File

@ -27,8 +27,8 @@ func getPatchset(w http.ResponseWriter, pbname string) {
fmt.Fprintf(w, msg) fmt.Fprintf(w, msg)
return return
} }
var m *forgepb.Patchs var m *forgepb.Patchset
m = new(forgepb.Patchs) m = new(forgepb.Patchset)
if err := m.Unmarshal(data); err != nil { if err := m.Unmarshal(data); err != nil {
msg := fmt.Sprintf("proto.Unmarshal() failed on %s len=%d\n", filename, len(data)) msg := fmt.Sprintf("proto.Unmarshal() failed on %s len=%d\n", filename, len(data))
fmt.Printf(msg) fmt.Printf(msg)
@ -62,8 +62,8 @@ func listPatchsets(w http.ResponseWriter) {
fmt.Println(entry.Name(), err) fmt.Println(entry.Name(), err)
continue continue
} }
var p *forgepb.Patchs var p *forgepb.Patchset
p = new(forgepb.Patchs) p = new(forgepb.Patchset)
err = p.Unmarshal(bytes) err = p.Unmarshal(bytes)
if err != nil { if err != nil {
fmt.Fprintln(w, entry.Name(), err) fmt.Fprintln(w, entry.Name(), err)
@ -80,8 +80,8 @@ func listPatchsets(w http.ResponseWriter) {
func savePatchset(w http.ResponseWriter, msg []byte) { func savePatchset(w http.ResponseWriter, msg []byte) {
log.Info("proto.Unmarshal() try message len", len(msg)) log.Info("proto.Unmarshal() try message len", len(msg))
var m *forgepb.Patchs var m *forgepb.Patchset
m = new(forgepb.Patchs) m = new(forgepb.Patchset)
if err := m.Unmarshal(msg); err != nil { if err := m.Unmarshal(msg); err != nil {
log.Info("proto.Unmarshal() failed on wire message len", len(msg)) log.Info("proto.Unmarshal() failed on wire message len", len(msg))
log.Info("error =", err) log.Info("error =", err)
@ -89,7 +89,7 @@ func savePatchset(w http.ResponseWriter, msg []byte) {
} }
log.Info("GOT patchset:", len(msg)) log.Info("GOT patchset:", len(msg))
fmt.Fprintln(w, "GOT patchset:", len(msg)) fmt.Fprintln(w, "GOT patchset:", len(msg))
all := m.SortByFilename() all := m.Patches.SortByFilename()
for all.Scan() { for all.Scan() {
repo := all.Next() repo := all.Next()
log.Info("filename:", repo.Filename) log.Info("filename:", repo.Filename)