(path string)
| 787 | } |
| 788 | |
| 789 | func (d *Github) getTreeDirectly(path string) (*TreeResp, string, error) { |
| 790 | p, err := d.get(path) |
| 791 | if err != nil { |
| 792 | return nil, "", err |
| 793 | } |
| 794 | if p.Entries == nil { |
| 795 | return nil, "", fmt.Errorf("%s is not a folder", path) |
| 796 | } |
| 797 | tree, err := d.getTree(p.Sha) |
| 798 | if err != nil { |
| 799 | return nil, "", err |
| 800 | } |
| 801 | if tree.Truncated { |
| 802 | return nil, "", fmt.Errorf("tree %s is truncated", path) |
| 803 | } |
| 804 | return tree, p.Sha, nil |
| 805 | } |
| 806 | |
| 807 | func (d *Github) newTree(baseSha string, tree []interface{}) (string, error) { |
| 808 | body := &TreeReq{Trees: tree} |
no test coverage detected