* Utility function used by get(Commit|WorkingDirectory)Diff. * * Parses the output from a diff-like command that uses `--path-with-raw`
(output: Buffer)
| 753 | * Parses the output from a diff-like command that uses `--path-with-raw` |
| 754 | */ |
| 755 | function diffFromRawDiffOutput(output: Buffer): IRawDiff { |
| 756 | // for now we just assume the diff is UTF-8, but given we have the raw buffer |
| 757 | // we can try and convert this into other encodings in the future |
| 758 | const result = output.toString('utf-8') |
| 759 | |
| 760 | const pieces = result.split('\0') |
| 761 | const parser = new DiffParser() |
| 762 | return parser.parse(forceUnwrap(`Invalid diff output`, pieces.at(-1))) |
| 763 | } |
| 764 | |
| 765 | async function buildSubmoduleDiff( |
| 766 | buffer: Buffer, |
no test coverage detected