Skip to content

Commit

Permalink
Fix repo.read
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Dec 22, 2014
1 parent cc459cd commit 96f58f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 2 additions & 5 deletions github.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,8 @@
if (err && err.error === 404) return cb("not found", null, null);

if (err) return cb(err);
var sha = obj.sha,
content = atob(obj.content);

cb(null, content, sha);
});
cb(null, obj);
}, true);
};


Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "github-api",
"version": "0.10.1",
"version": "0.10.2",
"description": "A higher-level wrapper around the Github API.",
"main": "github.js",
"dependencies": {
"atob": "^1.1.2",
"btoa": "^1.1.2",
"underscore": "~1.6.0",
"xmlhttprequest": "~1.6.0"
Expand Down
9 changes: 8 additions & 1 deletion test/test.repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ test("Repo API", function(t) {
});
});

t.test('repo.read', function(q) {
repo.read('master', 'README.md', function(err, res) {
q.ok(res.indexOf('##Setup') !== -1, true, 'Returned REAMDE');
q.end();
});
});

clearTimeout(timeout);
t.end();

Expand Down Expand Up @@ -81,7 +88,7 @@ test('delete Repo', function(t) {
clearTimeout(timeout);
t.end();
});

});

test('Repo Returns commit errors correctly', function(t) {
Expand Down

0 comments on commit 96f58f7

Please sign in to comment.