MCPcopy
hub / github.com/OpenListTeam/OpenList / getTree

Method getTree

drivers/github/driver.go:774–787  ·  view source on GitHub ↗
(sha string)

Source from the content-addressed store, hash-verified

772}
773
774func (d *Github) getTree(sha string) (*TreeResp, error) {
775 res, err := d.client.R().Get(fmt.Sprintf("https://api.github.com/repos/%s/%s/git/trees/%s", d.Owner, d.Repo, sha))
776 if err != nil {
777 return nil, err
778 }
779 if res.StatusCode() != 200 {
780 return nil, toErr(res)
781 }
782 var resp TreeResp
783 if err = utils.Json.Unmarshal(res.Body(), &resp); err != nil {
784 return nil, err
785 }
786 return &resp, nil
787}
788
789func (d *Github) getTreeDirectly(path string) (*TreeResp, string, error) {
790 p, err := d.get(path)

Callers 2

ListMethod · 0.95
getTreeDirectlyMethod · 0.95

Calls 3

toErrFunction · 0.85
GetMethod · 0.65
UnmarshalMethod · 0.45

Tested by

no test coverage detected