Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions github.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
// -------

Expand Down
9 changes: 9 additions & 0 deletions test/github-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down