Conversation
Codecov Report
@@ Coverage Diff @@
## master #46 +/- ##
==========================================
+ Coverage 28.12% 28.31% +0.18%
==========================================
Files 5 5
Lines 1152 1155 +3
==========================================
+ Hits 324 327 +3
+ Misses 784 783 -1
- Partials 44 45 +1
Continue to review full report at Codecov.
|
keegancsmith
left a comment
There was a problem hiding this comment.
LGTM. What happened previously in this code when diffing binary files? Do you need any special settings for git for this to work?
diff/parse.go
Outdated
| var err error | ||
| switch { | ||
| case (len(fd.Extended) == 3 || len(fd.Extended) == 4 && strings.HasPrefix(fd.Extended[3], "Binary files ")) && | ||
| case (len(fd.Extended) == 3 || len(fd.Extended) == 4 && strings.HasPrefix(fd.Extended[3], "Binary files ") || len(fd.Extended) > 4 && strings.HasPrefix(fd.Extended[3], "GIT binary patch")) && |
There was a problem hiding this comment.
looks like this conditional is big enough and repeated enough to be factored out?
There was a problem hiding this comment.
Made it smaller and replaced the common len check by a variable
|
Previously the file paths would be empty strings, now they are properly populated |
This adds support for parsing the cases in ./diff/testdata/sample_binary_inline.diff correctly.