Skip to content
This repository
Browse code

Merge pull request #2 from neiltron/master

Adds a list_commits method
  • Loading branch information...
commit 7c542916421f2a928c4e805aff0430eeb45e27e6 2 parents 2e66afc + 27e79cc
Michael Aufreiter authored

Showing 2 changed files with 19 additions and 0 deletions. Show diff stats Hide diff stats

  1. +10 0 github.js
  2. +9 0 test/github-test.js
10 github.js
@@ -192,6 +192,16 @@
192 192 });
193 193 };
194 194
  195 + // List all commits
  196 + // -------
  197 +
  198 + this.list_commits = function (cb) {
  199 + _request("GET", repoPath + "/commits", null, function(err, res) {
  200 + if (err) return cb(err);
  201 + cb(null, res);
  202 + });
  203 + };
  204 +
195 205 // Write file contents on a given path
196 206 // -------
197 207
9 test/github-test.js
@@ -32,6 +32,15 @@
32 32 });
33 33 });
34 34
  35 + test('should be capable of returning all commits', function () {
  36 + var github = new Github({username: USERNAME, password: PASSWORD, auth: "basic"});
  37 + var repo = github.getRepo(REPO);
  38 +
  39 + repo.list_commits(function(err, res) {
  40 + //console.log(err, res)
  41 + });
  42 + })
  43 +
35 44 test('should be capable of writing files', function() {
36 45 var github = new Github({username: USERNAME, password: PASSWORD, auth: "basic"});
37 46 var repo = github.getRepo(REPO);

0 comments on commit 7c54291

Please sign in to comment.
Something went wrong with that request. Please try again.