()
| 518 | } |
| 519 | |
| 520 | func DefaultDiffOptions() (DiffOptions, error) { |
| 521 | opts := C.git_diff_options{} |
| 522 | |
| 523 | runtime.LockOSThread() |
| 524 | defer runtime.UnlockOSThread() |
| 525 | |
| 526 | ecode := C.git_diff_options_init(&opts, C.GIT_DIFF_OPTIONS_VERSION) |
| 527 | if ecode < 0 { |
| 528 | return DiffOptions{}, MakeGitError(ecode) |
| 529 | } |
| 530 | |
| 531 | return DiffOptions{ |
| 532 | Flags: DiffOptionsFlag(opts.flags), |
| 533 | IgnoreSubmodules: SubmoduleIgnore(opts.ignore_submodules), |
| 534 | Pathspec: makeStringsFromCStrings(opts.pathspec.strings, int(opts.pathspec.count)), |
| 535 | ContextLines: uint32(opts.context_lines), |
| 536 | InterhunkLines: uint32(opts.interhunk_lines), |
| 537 | IdAbbrev: uint16(opts.id_abbrev), |
| 538 | MaxSize: int(opts.max_size), |
| 539 | OldPrefix: "a", |
| 540 | NewPrefix: "b", |
| 541 | }, nil |
| 542 | } |
| 543 | |
| 544 | type DiffFindOptionsFlag int |
| 545 |
searching dependent graphs…