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:
Billy Keyes
2025-01-07 19:27:03 -08:00
committed by GitHub
parent 8584cd59af
commit 14da3d30f7
2 changed files with 21 additions and 4 deletions
+10
View File
@@ -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,