(filepath, content, gitDiffFlags = ['-U1'])
| 13 | * @return {!Promise<string>} |
| 14 | */ |
| 15 | const diffTentative = (filepath, content, gitDiffFlags = ['-U1']) => |
| 16 | tempy.write.task(content, (temporary) => |
| 17 | getStdout( |
| 18 | [ |
| 19 | 'git -c color.ui=always diff', |
| 20 | ...gitDiffFlags, |
| 21 | filepath, |
| 22 | temporary, |
| 23 | ].join(' ') |
| 24 | ) |
| 25 | .trim() |
| 26 | .replace(new RegExp(temporary, 'g'), `/${filepath}`) |
| 27 | ); |
| 28 | |
| 29 | /** |
| 30 | * Diffs a file against new content. |
no test coverage detected