Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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 with 19 additions and 0 deletions.
  1. +10 −0 github.js
  2. +9 −0 test/github-test.js
View
10 github.js
@@ -192,6 +192,16 @@
});
};
+ // List all commits
+ // -------
+
+ this.list_commits = function (cb) {
+ _request("GET", repoPath + "/commits", null, function(err, res) {
+ if (err) return cb(err);
+ cb(null, res);
+ });
+ };
+
// Write file contents on a given path
// -------
View
9 test/github-test.js
@@ -32,6 +32,15 @@
});
});
+ test('should be capable of returning all commits', function () {
+ var github = new Github({username: USERNAME, password: PASSWORD, auth: "basic"});
+ var repo = github.getRepo(REPO);
+
+ repo.list_commits(function(err, res) {
+ //console.log(err, res)
+ });
+ })
+
test('should be capable of writing files', function() {
var github = new Github({username: USERNAME, password: PASSWORD, auth: "basic"});
var repo = github.getRepo(REPO);

0 comments on commit 7c54291

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