(sha string)
| 772 | } |
| 773 | |
| 774 | func (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 | |
| 789 | func (d *Github) getTreeDirectly(path string) (*TreeResp, string, error) { |
| 790 | p, err := d.get(path) |
no test coverage detected