8000 Bug (or documentation error) in the arguments to Diff.blobToBuffer · Issue #963 · nodegit/nodegit · GitHub
[go: up one dir, main page]

Skip to content

Bug (or documentation error) in the arguments to Diff.blobToBuffer #963

@tylerchurch

Description

@tylerchurch

If you look at the argument list here for Diff.blobToBuffer: http://www.nodegit.org/api/diff/

And then compare that to the argument list that's actually exposed in the code;

Diff.blobToBuffer= function(

They're different, with the actual API lacking the arguments buffer_len (and actually computing this value itself) and payload.

I'd submit a fix the documentation or the API, but I wasn't sure which one was the buggy one - seems to me like computing buffer_len inside blobToBuffer is intentional, but it also seems odd to me (e.g. what happens if the buffer passed in isn't UTF-8? The current code assumes that it is, and I imagine it would compute an incorrect length for non UTF-8 buffers.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0