(ptr *C.git_commit, repo *Repository)
| 130 | } |
| 131 | |
| 132 | func allocCommit(ptr *C.git_commit, repo *Repository) *Commit { |
| 133 | commit := &Commit{ |
| 134 | Object: Object{ |
| 135 | ptr: (*C.git_object)(ptr), |
| 136 | repo: repo, |
| 137 | }, |
| 138 | cast_ptr: ptr, |
| 139 | } |
| 140 | runtime.SetFinalizer(commit, (*Commit).Free) |
| 141 | |
| 142 | return commit |
| 143 | } |
| 144 | |
| 145 | func (o *Object) AsCommit() (*Commit, error) { |
| 146 | cobj, err := dupObject(o, ObjectCommit) |