(opts: Partial<GitDiffOptions>)
| 19 | } |
| 20 | |
| 21 | export function gitDiffOptionsToFlags(opts: Partial<GitDiffOptions>) { |
| 22 | const flags = []; |
| 23 | if (opts.ignoreAllSpace) { |
| 24 | flags.push('-w'); |
| 25 | } |
| 26 | if (opts.ignoreSpaceChange) { |
| 27 | flags.push('-b'); |
| 28 | } |
| 29 | if (opts.diffAlgorithm) { |
| 30 | flags.push(`--diff-algorithm=${opts.diffAlgorithm}`); |
| 31 | } |
| 32 | if (opts.unified) { |
| 33 | flags.push(`-U${opts.unified}`); |
| 34 | } |
| 35 | if (opts.findRenames) { |
| 36 | flags.push(`--find-renames=${opts.findRenames}%`); |
| 37 | } |
| 38 | if (opts.findCopies) { |
| 39 | flags.push(`--find-copies=${opts.findCopies}%`); |
| 40 | } |
| 41 | if (opts.functionContext) { |
| 42 | flags.push('-W'); |
| 43 | } |
| 44 | return flags; |
| 45 | } |
| 46 | |
| 47 | export function flagsToGitDiffOptions(flags: string[]): Partial<GitDiffOptions> { |
| 48 | const options: Partial<GitDiffOptions> = {}; |
no outgoing calls
no test coverage detected