-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support binary file diff (fixes #17)
- Loading branch information
Showing
11 changed files
with
158 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
diff --git a/file1 b/file1 | ||
index 21be030..9443748 100644 | ||
Binary files a/file1 and b/file1 differ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
diff --git a/file1 b/file1 | ||
deleted file mode 100644 | ||
index 21be030..0000000 | ||
Binary files a/file1 and /dev/null differ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
diff --git a/file1 b/file1 | ||
new file mode 100644 | ||
index 0000000..21be030 | ||
Binary files /dev/null and b/file1 differ |
20 changes: 20 additions & 0 deletions
20
src/__tests__/__snapshots__/changed-binary-file.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`changed binary file parse \`changed-binary-file\` 1`] = ` | ||
{ | ||
"files": [ | ||
{ | ||
"chunks": [ | ||
{ | ||
"pathAfter": "file1", | ||
"pathBefore": "file1", | ||
"type": "BinaryFilesChunk", | ||
}, | ||
], | ||
"path": "file1", | ||
"type": "ChangedFile", | ||
}, | ||
], | ||
"type": "GitDiff", | ||
} | ||
`; |
20 changes: 20 additions & 0 deletions
20
src/__tests__/__snapshots__/deleted-binary-file.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`deleted binary file parse \`deleted-binary-file\` 1`] = ` | ||
{ | ||
"files": [ | ||
{ | ||
"chunks": [ | ||
{ | ||
"pathAfter": "/dev/null", | ||
"pathBefore": "file1", | ||
"type": "BinaryFilesChunk", | ||
}, | ||
], | ||
"path": "file1", | ||
"type": "DeletedFile", | ||
}, | ||
], | ||
"type": "GitDiff", | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`new-binary-file parse \`new-binary-file\` 1`] = ` | ||
{ | ||
"files": [ | ||
{ | ||
"chunks": [ | ||
{ | ||
"pathAfter": "file1", | ||
"pathBefore": "/dev/null", | ||
"type": "BinaryFilesChunk", | ||
}, | ||
], | ||
"path": "file1", | ||
"type": "AddedFile", | ||
}, | ||
], | ||
"type": "GitDiff", | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { getFixture } from './test-utils'; | ||
import parseGitDiff from '../parse-git-diff'; | ||
|
||
describe('changed binary file', () => { | ||
const fixture = getFixture('changed-binary-file'); | ||
|
||
it('parse `changed-binary-file`', () => { | ||
expect(parseGitDiff(fixture)).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { getFixture } from './test-utils'; | ||
import parseGitDiff from '../parse-git-diff'; | ||
|
||
describe('deleted binary file', () => { | ||
const fixture = getFixture('deleted-binary-file'); | ||
|
||
it('parse `deleted-binary-file`', () => { | ||
expect(parseGitDiff(fixture)).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { getFixture } from './test-utils'; | ||
import parseGitDiff from '../parse-git-diff'; | ||
|
||
describe('new-binary-file', () => { | ||
const fixture = getFixture('new-binary-file'); | ||
|
||
it('parse `new-binary-file`', () => { | ||
expect(parseGitDiff(fixture)).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters