diff options
Diffstat (limited to 'doPatchsets.go')
| -rw-r--r-- | doPatchsets.go | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/doPatchsets.go b/doPatchsets.go index caf73bc..3920ec3 100644 --- a/doPatchsets.go +++ b/doPatchsets.go @@ -97,45 +97,6 @@ func getPatchset(w http.ResponseWriter, pbname string) { w.Write(data) } -func listPatchsets(w http.ResponseWriter) { - dirname := filepath.Join(LIBDIR, "patchset/") - // Open the directory - entries, err := os.ReadDir(dirname) - if err != nil { - fmt.Printf("Error reading directory: %v\n", err) - fmt.Fprintf(w, "Error reading directory: %v\n", err) - return - } - - // Iterate through the directory entries - for _, entry := range entries { - // Check if the entry is a file and matches the *.pb pattern - if !entry.IsDir() && filepath.Ext(entry.Name()) == ".pb" { - bytes, err := os.ReadFile(filepath.Join(dirname, entry.Name())) - if err != nil { - fmt.Fprintln(w, entry.Name(), err) - fmt.Println(entry.Name(), err) - continue - } - var p *forgepb.Patchset - p = new(forgepb.Patchset) - err = p.Unmarshal(bytes) - if err != nil { - fmt.Fprintln(w, entry.Name(), err) - fmt.Println(entry.Name(), err) - continue - } - author := "Author: " + p.GitAuthorName - author += " <" + p.GitAuthorEmail + ">" - - // author := "Author: " + os.Getenv("GIT_AUTHOR_NAME") - // author += " <" + os.Getenv("GIT_AUTHOR_EMAIL") + ">" - fmt.Fprintln(w, entry.Name(), p.Name, p.Comment, author) - fmt.Println(entry.Name(), p.Name, p.Comment, author) - } - } -} - func savePatchset(w http.ResponseWriter, msg []byte) error { // log.Info("proto.Unmarshal() try message len", len(msg)) var m *forgepb.Patchset |
