From 96f58f768c6dfae5b176fb2d03050f74b711b9fd Mon Sep 17 00:00:00 2001 From: ingalls Date: Mon, 22 Dec 2014 10:24:06 -0500 Subject: [PATCH] Fix repo.read --- github.js | 7 ++----- package.json | 3 ++- test/test.repo.js | 9 ++++++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/github.js b/github.js index 62952257..e45e5d50 100644 --- a/github.js +++ b/github.js @@ -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); }; diff --git a/package.json b/package.json index 69e50795..4bf56eab 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/test/test.repo.js b/test/test.repo.js index 79a7196d..74e872d6 100644 --- a/test/test.repo.js +++ b/test/test.repo.js @@ -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(); @@ -81,7 +88,7 @@ test('delete Repo', function(t) { clearTimeout(timeout); t.end(); }); - + }); test('Repo Returns commit errors correctly', function(t) {