ReadTree replaces the contents of the index with those of the given tree
(tree *Tree)
| 403 | // ReadTree replaces the contents of the index with those of the given |
| 404 | // tree |
| 405 | func (v *Index) ReadTree(tree *Tree) error { |
| 406 | runtime.LockOSThread() |
| 407 | defer runtime.UnlockOSThread() |
| 408 | |
| 409 | ret := C.git_index_read_tree(v.ptr, tree.cast_ptr) |
| 410 | runtime.KeepAlive(v) |
| 411 | runtime.KeepAlive(tree) |
| 412 | if ret < 0 { |
| 413 | return MakeGitError(ret) |
| 414 | } |
| 415 | |
| 416 | return nil |
| 417 | } |
| 418 | |
| 419 | func (v *Index) WriteTree() (*Oid, error) { |
| 420 | oid := new(Oid) |