Permalink
Browse files

add ability to list all commits in a repo

  • Loading branch information...
1 parent 1a00668 commit 27e79cc9db2154bb0870cce154b8f4dc2487817a @neiltron neiltron committed Mar 19, 2012
Showing with 19 additions and 0 deletions.
  1. +10 −0 github.js
  2. +9 −0 test/github-test.js
View
@@ -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
@@ -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 27e79cc

Please sign in to comment.