export hunkApplyCallback
(_hunk *C.git_diff_hunk, _payload unsafe.Pointer)
| 910 | |
| 911 | //export hunkApplyCallback |
| 912 | func hunkApplyCallback(_hunk *C.git_diff_hunk, _payload unsafe.Pointer) C.int { |
| 913 | data, ok := pointerHandles.Get(_payload).(*applyCallbackData) |
| 914 | if !ok { |
| 915 | panic("invalid apply options payload") |
| 916 | } |
| 917 | |
| 918 | if data.options.ApplyHunkCallback == nil { |
| 919 | return C.int(ErrorCodeOK) |
| 920 | } |
| 921 | |
| 922 | hunk := diffHunkFromC(_hunk) |
| 923 | |
| 924 | apply, err := data.options.ApplyHunkCallback(&hunk) |
| 925 | if err != nil { |
| 926 | *data.errorTarget = err |
| 927 | return C.int(ErrorCodeUser) |
| 928 | } |
| 929 | |
| 930 | if !apply { |
| 931 | return 1 |
| 932 | } |
| 933 | return C.int(ErrorCodeOK) |
| 934 | } |
| 935 | |
| 936 | //export deltaApplyCallback |
| 937 | func deltaApplyCallback(_delta *C.git_diff_delta, _payload unsafe.Pointer) C.int { |
nothing calls this directly
no test coverage detected
searching dependent graphs…