Fix conflicter by removing toString() call#736
Conversation
|
👍 fix |
|
How does the diff look like? |
|
It just removes a toString() call from file.content buffer before giving it to conflicter ... |
|
Yeah, I know, but I'm wondering how the diff looks like when diffing two files with the conflicter if one is a buffer. |
|
@kevva sorry, i thought you could not read the diff in github for some reason :) In fact it's a good question, because displaying the diff produce an exception ! I'll fix too ... |
detect-conflict dependency handles buffers properly, so this toString() call is not required anymore and cause false positive on conflicter. Close yeoman#717
56484b8 to
94b4cf2
Compare
|
Adding .toString() before calling diff fix the exception. I've check in https://github.com/yeoman/generator/blob/master/lib/util/conflicter.js#L168 That beeing said, does it really make sense to display a diff on binary files ? Maybe we could check if file is binary with istextorbinary, and use a different diff tool for those kind of files if it's revelant ? |
Yes, for binary file we should show file size difference and modified/created time difference. |
|
Would you like the implementation to be part of this PR ? |
|
@Toilal Nah, separate PR. |
Fix conflicter by removing toString() call
|
Let's follow up with a separate PR fixing diffing for binary file. Thanks for digging into this! |
detect-conflict dependency handles buffers properly, so this toString() call is not required anymore and cause false positive on conflicter.
Close #717