(oldTree *Tree, index *Index, opts *DiffOptions)
| 745 | } |
| 746 | |
| 747 | func (v *Repository) DiffTreeToIndex(oldTree *Tree, index *Index, opts *DiffOptions) (*Diff, error) { |
| 748 | var diffPtr *C.git_diff |
| 749 | var oldPtr *C.git_tree |
| 750 | var indexPtr *C.git_index |
| 751 | |
| 752 | if oldTree != nil { |
| 753 | oldPtr = oldTree.cast_ptr |
| 754 | } |
| 755 | |
| 756 | if index != nil { |
| 757 | indexPtr = index.ptr |
| 758 | } |
| 759 | |
| 760 | var err error |
| 761 | copts := populateDiffOptions(&C.git_diff_options{}, opts, v, &err) |
| 762 | defer freeDiffOptions(copts) |
| 763 | |
| 764 | runtime.LockOSThread() |
| 765 | defer runtime.UnlockOSThread() |
| 766 | |
| 767 | ret := C.git_diff_tree_to_index(&diffPtr, v.ptr, oldPtr, indexPtr, copts) |
| 768 | runtime.KeepAlive(oldTree) |
| 769 | runtime.KeepAlive(index) |
| 770 | if ret == C.int(ErrorCodeUser) && err != nil { |
| 771 | return nil, err |
| 772 | } |
| 773 | if ret < 0 { |
| 774 | return nil, MakeGitError(ret) |
| 775 | } |
| 776 | |
| 777 | return newDiffFromC(diffPtr, v), nil |
| 778 | } |
| 779 | |
| 780 | func (v *Repository) DiffTreeToWorkdirWithIndex(oldTree *Tree, opts *DiffOptions) (*Diff, error) { |
| 781 | var diffPtr *C.git_diff |
nothing calls this directly
no test coverage detected