summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-27 21:29:20 -0600
committerJeff Carr <[email protected]>2024-12-28 20:02:07 -0600
commit20ea487d06cfdb851e0122baea6504df41678cef (patch)
treecbc69ee6bf9d19dd061ffd59d6ea057fe074a3d8
parent7a8f54a192640c1a55db23f11ed8d8ca29cd1c22 (diff)
show the patch namesv0.22.26
-rw-r--r--patchsets.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/patchsets.go b/patchsets.go
index 3dd7ba5..5638187 100644
--- a/patchsets.go
+++ b/patchsets.go
@@ -56,8 +56,22 @@ func listPatchsets(w http.ResponseWriter) {
for _, entry := range entries {
// Check if the entry is a file and matches the *.pb pattern
if !entry.IsDir() && filepath.Ext(entry.Name()) == ".pb" {
- fmt.Fprintln(w, entry.Name())
- fmt.Println(entry.Name())
+ 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.Patchs
+ p = new(forgepb.Patchs)
+ err = p.Unmarshal(bytes)
+ if err != nil {
+ fmt.Fprintln(w, entry.Name(), err)
+ fmt.Println(entry.Name(), err)
+ continue
+ }
+ fmt.Fprintln(w, entry.Name(), p.Name, p.Comment)
+ fmt.Println(entry.Name(), p.Name, p.Comment)
}
}
}