| 193 | } |
| 194 | |
| 195 | func (diff *Diff) FindSimilar(opts *DiffFindOptions) error { |
| 196 | |
| 197 | var copts *C.git_diff_find_options |
| 198 | if opts != nil { |
| 199 | copts = &C.git_diff_find_options{ |
| 200 | version: C.GIT_DIFF_FIND_OPTIONS_VERSION, |
| 201 | flags: C.uint32_t(opts.Flags), |
| 202 | rename_threshold: C.uint16_t(opts.RenameThreshold), |
| 203 | copy_threshold: C.uint16_t(opts.CopyThreshold), |
| 204 | rename_from_rewrite_threshold: C.uint16_t(opts.RenameFromRewriteThreshold), |
| 205 | break_rewrite_threshold: C.uint16_t(opts.BreakRewriteThreshold), |
| 206 | rename_limit: C.size_t(opts.RenameLimit), |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | runtime.LockOSThread() |
| 211 | defer runtime.UnlockOSThread() |
| 212 | |
| 213 | ecode := C.git_diff_find_similar(diff.ptr, copts) |
| 214 | runtime.KeepAlive(diff) |
| 215 | if ecode < 0 { |
| 216 | return MakeGitError(ecode) |
| 217 | } |
| 218 | |
| 219 | return nil |
| 220 | } |
| 221 | |
| 222 | type DiffStats struct { |
| 223 | doNotCompare |