(oldTree *Tree, opts *DiffOptions)
| 718 | } |
| 719 | |
| 720 | func (v *Repository) DiffTreeToWorkdir(oldTree *Tree, opts *DiffOptions) (*Diff, error) { |
| 721 | var diffPtr *C.git_diff |
| 722 | var oldPtr *C.git_tree |
| 723 | |
| 724 | if oldTree != nil { |
| 725 | oldPtr = oldTree.cast_ptr |
| 726 | } |
| 727 | |
| 728 | var err error |
| 729 | copts := populateDiffOptions(&C.git_diff_options{}, opts, v, &err) |
| 730 | defer freeDiffOptions(copts) |
| 731 | |
| 732 | runtime.LockOSThread() |
| 733 | defer runtime.UnlockOSThread() |
| 734 | |
| 735 | ret := C.git_diff_tree_to_workdir(&diffPtr, v.ptr, oldPtr, copts) |
| 736 | runtime.KeepAlive(oldTree) |
| 737 | if ret == C.int(ErrorCodeUser) && err != nil { |
| 738 | return nil, err |
| 739 | } |
| 740 | if ret < 0 { |
| 741 | return nil, MakeGitError(ret) |
| 742 | } |
| 743 | |
| 744 | return newDiffFromC(diffPtr, v), nil |
| 745 | } |
| 746 | |
| 747 | func (v *Repository) DiffTreeToIndex(oldTree *Tree, index *Index, opts *DiffOptions) (*Diff, error) { |
| 748 | var diffPtr *C.git_diff |
nothing calls this directly
no test coverage detected