Skip to content

Commit 8a09caa

Browse files
committed
Removed non-working code
it is guaranteed to not work as it stands, as we do not get the uri property in the req object at all (atleast when testing with github) and with github enterprise - things just dont't get set up correctly in the first place. Also, the string /api/v3 will be a part of the uri (which is not present in the result), however - a part of the endpoint URL and not a part of the path (which is present in the result) in any case.
1 parent 34c4748 commit 8a09caa

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

lib/api.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var debug = require('debug')('strider-github:api');
66
var Step = require('step');
77
var superagent = require('superagent');
88
var url = require('url');
9+
var util = require('util');
910

1011
var GITHUB_API_ENDPOINT = process.env.PLUGIN_GITHUB_API_ENDPOINT || 'https://api.github.com';
1112

@@ -418,16 +419,9 @@ function getRepos(token, username, callback) {
418419

419420
_.each(results, function (result) {
420421
var team_id = result.req.path.split('/');
421-
if (result.req.path.indexOf('/api/v3/') > -1) {
422-
// Github Enterprise url
423-
team_id = team_id[4]; //TODO: need a github enterprise account for
424-
// this to be tested - does the path
425-
// really contain /api/v3?
426-
}
427-
else {
428-
// Github url
429-
team_id = team_id[2];
430-
}
422+
debug("We get the following repo path: " + util.inspect(result.req.path));
423+
team_id = team_id[2];
424+
431425
var team_detail = team_detail_requests[parseInt(team_id, 10)];
432426
if (result.statusCode === 204) {
433427
pageinated_api_call('/teams/' + team_id + '/repos', token, group());

test/test_api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
var expect = require('expect.js')
3-
, api = require('../lib/api')
3+
, api = require('../lib/api');
44

55
describe('github api', function () {
66
describe('getFile', function () {

0 commit comments

Comments
 (0)