Skip to content

How to retrieve blob with binary content? #83

Description

@philschatz

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?

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