More diff functionality #629

Merged
mbfr merged 24 commits from feature-diff-extra into master 2020-08-18 08:14:03 -05:00
1 changed files with 7 additions and 7 deletions
Showing only changes of commit ad65e109e4 - Show all commits

10
diff.go
View File

@ -850,16 +850,16 @@ func DiffBlobs(oldBlob *Blob, oldAsPath string, newBlob *Blob, newAsPath string,
return nil
}
type ApplyHunkCallback func(*DiffHunk) (apply bool, err error)
type ApplyDeltaCallback func(*DiffDelta) (apply bool, err error)
type ApplyHunkCb func(*DiffHunk) (apply bool, err error)
type ApplyDeltaCb func(*DiffDelta) (apply bool, err error)
// ApplyOptions has 2 callbacks that are called for hunks or deltas
// If these functions return an error, abort the apply process immediately.
// If the first resutnr 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 {
Version uint
ApplyHunkCallback
ApplyDeltaCallback
ApplyHunkCallback ApplyHunkCb
ApplyDeltaCallback ApplyDeltaCb
Flags uint
}