8000 diff.blobToBuffer: Fix passing in Buffers instead of strings. by tylerchurch · Pull Request #964 · nodegit/nodegit · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
J 8000 ump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Diff.blobToBuffer= function(
var bufferLength;
if (buffer instanceof Buffer) {
bufferText = buffer.toString("utf8");
bufferLength = buffer.length;
bufferLength = Buffer.byteLength(buffer, "utf8");
} else {
bufferText = buffer;
bufferLength = !buffer ? 0 : Buffer.byteLength(buffer, "utf8");
Expand All @@ -84,7 +84,7 @@ Diff.blobToBuffer= function(
this,
old_blob,
old_as_path,
buffer,
bufferText,
bufferLength,
buffer_as_path,
opts,
Expand Down
0