mirror of
https://github.com/bluekeyes/go-gitdiff
synced 2026-06-08 13:18:30 +00:00
Parse binary headers with file paths (#55)
Some patches may include one or more file paths as part of the binary header when there is no binary data. Git accounts for this by only checking the prefix and suffix of the line, but I missed that logic when implementing this originally.
This commit is contained in:
@@ -25,6 +25,16 @@ func TestParseBinaryMarker(t *testing.T) {
|
||||
IsBinary: true,
|
||||
HasData: false,
|
||||
},
|
||||
"binaryFileNoPatchPaths": {
|
||||
Input: "Binary files a/foo.bin and b/foo.bin differ\n",
|
||||
IsBinary: true,
|
||||
HasData: false,
|
||||
},
|
||||
"fileNoPatch": {
|
||||
Input: "Files differ\n",
|
||||
IsBinary: true,
|
||||
HasData: false,
|
||||
},
|
||||
"textFile": {
|
||||
Input: "@@ -10,14 +22,31 @@\n",
|
||||
IsBinary: false,
|
||||
|
||||
Reference in New Issue
Block a user