(ptr *C.git_tree, repo *Repository)
| 108 | } |
| 109 | |
| 110 | func allocTree(ptr *C.git_tree, repo *Repository) *Tree { |
| 111 | tree := &Tree{ |
| 112 | Object: Object{ |
| 113 | ptr: (*C.git_object)(ptr), |
| 114 | repo: repo, |
| 115 | }, |
| 116 | cast_ptr: ptr, |
| 117 | } |
| 118 | runtime.SetFinalizer(tree, (*Tree).Free) |
| 119 | |
| 120 | return tree |
| 121 | } |
| 122 | |
| 123 | func (o *Object) AsTree() (*Tree, error) { |
| 124 | cobj, err := dupObject(o, ObjectTree) |