Fix list-pulls stopping if a repo has no pull requests
Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/8ce13077 Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/8ce13077 Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/8ce13077 Branch: refs/heads/master Commit: 8ce13077bb44a5c80fd513199d1712327c9d03f2 Parents: cd1a9e6 Author: Andrew Grieve <[email protected]> Authored: Tue Apr 29 09:54:15 2014 -0400 Committer: Andrew Grieve <[email protected]> Committed: Tue Apr 29 09:54:15 2014 -0400 ---------------------------------------------------------------------- src/list-pulls.js | 3 +++ 1 file changed, 3 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/8ce13077/src/list-pulls.js ---------------------------------------------------------------------- diff --git a/src/list-pulls.js b/src/list-pulls.js index d7e16e3..b2110ea 100644 --- a/src/list-pulls.js +++ b/src/list-pulls.js @@ -29,6 +29,9 @@ var commentFailed = false; function addLastCommentInfo(repo, pullRequests, callback) { var remaining = pullRequests.length; + if (remaining === 0) { + callback(); + } pullRequests.forEach(function(pullRequest) { // review_comments_url is always empty, so resort to scraping. request.get({ url: 'https://github.com/apache/' + repo + '/pull/' + pullRequest.number, headers: { 'User-Agent': 'Cordova Coho' }}, function(err, res, payload) {
