(repo *Repository)
| 385 | } |
| 386 | |
| 387 | func (v *Index) WriteTreeTo(repo *Repository) (*Oid, error) { |
| 388 | oid := new(Oid) |
| 389 | |
| 390 | runtime.LockOSThread() |
| 391 | defer runtime.UnlockOSThread() |
| 392 | |
| 393 | ret := C.git_index_write_tree_to(oid.toC(), v.ptr, repo.ptr) |
| 394 | runtime.KeepAlive(v) |
| 395 | runtime.KeepAlive(repo) |
| 396 | if ret < 0 { |
| 397 | return nil, MakeGitError(ret) |
| 398 | } |
| 399 | |
| 400 | return oid, nil |
| 401 | } |
| 402 | |
| 403 | // ReadTree replaces the contents of the index with those of the given |
| 404 | // tree |