From 10c67474a89c298172a6703b91980ea37c60d5e5 Mon Sep 17 00:00:00 2001 From: lhchavez Date: Thu, 10 Dec 2020 07:19:41 -0800 Subject: More callback refactoring (#713) This change: * Gets rid of the `.toC()` functions for Options objects, since they were redundant with the `populateXxxOptions()`. * Adds support for `errorTarget` to the `RemoteOptions`, since they are used in the same stack for some functions (like `Fetch()`). Now for those cases, the error returned by the callback will be preserved as-is. --- patch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'patch.go') diff --git a/patch.go b/patch.go index 6441751..b2595f1 100644 --- a/patch.go +++ b/patch.go @@ -78,7 +78,7 @@ func (v *Repository) PatchFromBuffers(oldPath, newPath string, oldBuf, newBuf [] defer C.free(unsafe.Pointer(cNewPath)) var err error - copts := opts.toC(v, &err) + copts := populateDiffOptions(&C.git_diff_options{}, opts, v, &err) defer freeDiffOptions(copts) runtime.LockOSThread() -- cgit v1.2.3