FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

How to retrieve blob with binary content? · Issue #83 · nodegit/nodegit · GitHub

Repository navigation

How to retrieve blob with binary content? #83

Description

Hello! I tried to retrieve a binary blob (a 13k PNG file) using the #wip branch (on OSX):

Git.Repo.open(REPO_PATH, function(error, repo) {
  repo.getBlob(oid, function(error, blob) {
    var content = blob.content();
    if (blob.isBinary()) {
      fs.writeFileSync('BROKEN.png', content);
    }
  });
});

The first 4 or 5 bytes seem to match (they are ffd8 ffe0 00) but the rest of the bytes seem to be random memory; they change on subsequent retrievals of the same blob.

However, text files seem to work. Am I doing something dumb?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL