From 633f7639dbe50390b31520aa54b8539d145a03c4 Mon Sep 17 00:00:00 2001 From: Michael Boulton Date: Tue, 18 Aug 2020 08:14:20 +0100 Subject: [PATCH] Hardcode version in apply options which should never change --- diff.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/diff.go b/diff.go index abb2ec1..42fc7b5 100644 --- a/diff.go +++ b/diff.go @@ -856,7 +856,6 @@ type ApplyDeltaCallback func(*DiffDelta) (apply bool, err error) // If these functions return an error, abort the apply process immediately. // If the first return value is true, the delta/hunk will be applied. If it is false, the delta/hunk will not be applied. In either case, the rest of the apply process will continue. type ApplyOptions struct { - Version uint ApplyHunkCallback ApplyHunkCallback ApplyDeltaCallback ApplyDeltaCallback Flags uint @@ -934,7 +933,7 @@ func (a *ApplyOptions) toC() *C.git_apply_options { } opts := &C.git_apply_options{ - version: C.uint(a.Version), + version: C.GIT_APPLY_OPTIONS_VERSION, flags: C.uint(a.Flags), } @@ -948,8 +947,7 @@ func (a *ApplyOptions) toC() *C.git_apply_options { func applyOptionsFromC(opts *C.git_apply_options) *ApplyOptions { return &ApplyOptions{ - Version: uint(opts.version), - Flags: uint(opts.flags), + Flags: uint(opts.flags), } }