Hardcode version in apply options which should never change

This commit is contained in:
Michael Boulton 2020-08-18 08:14:20 +01:00
parent 6dc7641069
commit 633f7639db
No known key found for this signature in database
GPG Key ID: 8A62CA0BE2E0197E
1 changed files with 2 additions and 4 deletions

View File

@ -856,7 +856,6 @@ type ApplyDeltaCallback func(*DiffDelta) (apply bool, err error)
// If these functions return an error, abort the apply process immediately. // 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. // 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 { type ApplyOptions struct {
Version uint
ApplyHunkCallback ApplyHunkCallback ApplyHunkCallback ApplyHunkCallback
ApplyDeltaCallback ApplyDeltaCallback ApplyDeltaCallback ApplyDeltaCallback
Flags uint Flags uint
@ -934,7 +933,7 @@ func (a *ApplyOptions) toC() *C.git_apply_options {
} }
opts := &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), 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 { func applyOptionsFromC(opts *C.git_apply_options) *ApplyOptions {
return &ApplyOptions{ return &ApplyOptions{
Version: uint(opts.version), Flags: uint(opts.flags),
Flags: uint(opts.flags),
} }
} }