Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

How to retrieve blob with binary content? #83

Copy link
Copy link
@philschatz

Description

@philschatz
Issue body actions

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?

Reactions are currently unavailable

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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.