(index *Index, opts *DiffOptions)
| 805 | } |
| 806 | |
| 807 | func (v *Repository) DiffIndexToWorkdir(index *Index, opts *DiffOptions) (*Diff, error) { |
| 808 | var diffPtr *C.git_diff |
| 809 | var indexPtr *C.git_index |
| 810 | |
| 811 | if index != nil { |
| 812 | indexPtr = index.ptr |
| 813 | } |
| 814 | |
| 815 | var err error |
| 816 | copts := populateDiffOptions(&C.git_diff_options{}, opts, v, &err) |
| 817 | defer freeDiffOptions(copts) |
| 818 | |
| 819 | runtime.LockOSThread() |
| 820 | defer runtime.UnlockOSThread() |
| 821 | |
| 822 | ret := C.git_diff_index_to_workdir(&diffPtr, v.ptr, indexPtr, copts) |
| 823 | runtime.KeepAlive(index) |
| 824 | if ret == C.int(ErrorCodeUser) && err != nil { |
| 825 | return nil, err |
| 826 | } |
| 827 | if ret < 0 { |
| 828 | return nil, MakeGitError(ret) |
| 829 | } |
| 830 | |
| 831 | return newDiffFromC(diffPtr, v), nil |
| 832 | } |
| 833 | |
| 834 | // DiffBlobs performs a diff between two arbitrary blobs. You can pass |
| 835 | // whatever file names you'd like for them to appear as in the diff. |
nothing calls this directly
no test coverage detected