MCPcopy Index your code
hub / github.com/desktop/desktop / parseDiff

Function parseDiff

app/test/unit/patch-formatter-test.ts:23–39  ·  view source on GitHub ↗
(diff: string)

Source from the content-addressed store, hash-verified

21import { setupFixtureRepository } from '../helpers/repositories'
22
23async function parseDiff(diff: string): Promise<ITextDiff> {
24 const parser = new DiffParser()
25 const rawDiff = parser.parse(diff)
26 const repository = new Repository('', -1, null, false)
27 const fileChange = new FileChange('file.txt', {
28 kind: AppFileStatusKind.Modified,
29 })
30 const output = await convertDiff(
31 repository,
32 fileChange,
33 rawDiff,
34 'HEAD',
35 'HEAD'
36 )
37 assert.equal(output.kind, DiffType.Text)
38 return output as ITextDiff
39}
40
41describe('patch formatting', () => {
42 describe('formatPatchesForModifiedFile', () => {

Callers 1

Calls 2

parseMethod · 0.95
convertDiffFunction · 0.90

Tested by

no test coverage detected