summaryrefslogtreecommitdiff
path: root/patchset.Get.go
blob: 4ad3c487a63c6f5245ac6fe38acd36bed155d5cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 1994-2025 WIT.COM Inc Licensed GPL 3.0

package forgepb

import (
	"go.wit.com/log"
)

func (f *Forge) GetPatchesets() (*Patchsets, error) {
	url := f.forgeURL + "GetPatchsets"
	log.Info("GetPatchsets() url", url)
	body, err := f.HttpPost(url, nil)
	if err != nil {
		log.Info("httpPost() failed:", err)
		return nil, err
	}
	log.Info("GetPatchets() len(body)", len(body))
	var psets *Patchsets
	psets = new(Patchsets)
	err = psets.Unmarshal(body)
	if err != nil {
		log.Info("Unmarshal failed", err)
		return nil, err
	}
	/*
		filename := filepath.Join("/tmp", pbfile)
		f, _ := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
		f.Write(body)
		f.Close()
	*/
	return psets, nil
}