Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 96f58f7

Browse files
committed
Fix repo.read
1 parent cc459cd commit 96f58f7

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

github.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,8 @@
542542
if (err && err.error === 404) return cb("not found", null, null);
543543

544544
if (err) return cb(err);
545-
var sha = obj.sha,
546-
content = atob(obj.content);
547-
548-
cb(null, content, sha);
549-
});
545+
cb(null, obj);
546+
}, true);
550547
};
551548

552549

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "github-api",
3-
"version": "0.10.1",
3+
"version": "0.10.2",
44
"description": "A higher-level wrapper around the Github API.",
55
"main": "github.js",
66
"dependencies": {
7+
"atob": "^1.1.2",
78
"btoa": "^1.1.2",
89
"underscore": "~1.6.0",
910
"xmlhttprequest": "~1.6.0"

test/test.repo.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ test("Repo API", function(t) {
4242
});
4343
});
4444

45+
t.test('repo.read', function(q) {
46+
repo.read('master', 'README.md', function(err, res) {
47+
q.ok(res.indexOf('##Setup') !== -1, true, 'Returned REAMDE');
48+
q.end();
49+
});
50+
});
51+
4552
clearTimeout(timeout);
4653
t.end();
4754

@@ -81,7 +88,7 @@ test('delete Repo', function(t) {
8188
clearTimeout(timeout);
8289
t.end();
8390
});
84-
91+
8592
});
8693

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

0 commit comments

Comments
 (0)