| 570 | } |
| 571 | |
| 572 | func (v *Index) Conflict(path string) (IndexConflict, error) { |
| 573 | |
| 574 | var cancestor *C.git_index_entry |
| 575 | var cour *C.git_index_entry |
| 576 | var ctheir *C.git_index_entry |
| 577 | |
| 578 | cpath := C.CString(path) |
| 579 | defer C.free(unsafe.Pointer(cpath)) |
| 580 | |
| 581 | runtime.LockOSThread() |
| 582 | defer runtime.UnlockOSThread() |
| 583 | |
| 584 | ecode := C.git_index_conflict_get(&cancestor, &cour, &ctheir, v.ptr, cpath) |
| 585 | if ecode < 0 { |
| 586 | return IndexConflict{}, MakeGitError(ecode) |
| 587 | } |
| 588 | ret := IndexConflict{ |
| 589 | Ancestor: newIndexEntryFromC(cancestor), |
| 590 | Our: newIndexEntryFromC(cour), |
| 591 | Their: newIndexEntryFromC(ctheir), |
| 592 | } |
| 593 | runtime.KeepAlive(v) |
| 594 | return ret, nil |
| 595 | } |
| 596 | |
| 597 | // deprecated: You should use `Index.Conflict()` instead. |
| 598 | func (v *Index) GetConflict(path string) (IndexConflict, error) { |