forked from octokit/octokit.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommitApi.js
47 lines (42 loc) · 1.53 KB
/
CommitApi.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
var sys = require("sys");
var AbstractApi = require("./AbstractApi").AbstractApi;
var CommitApi = exports.CommitApi = function(api) {
this.$api = api;
};
sys.inherits(CommitApi, AbstractApi);
(function() {
/**
* List commits by username, repo and branch
* http://develop.github.com/p/commits.html#listing_commits_on_a_branch
*
* @param {String} username the username
* @param {String} repo the repo
* @param {String} $branch the branch
* @return array list of users found
*/
this.getBranchCommits = function(username, repo, branch, callback)
{
this.$api.get(
'commits/list/' + encodeURI(username) + "/" + encodeURI(repo) + "/" + encodeURI(branch),
null, null,
this.$createListener(callback, "commits")
);
};
}).call(CommitApi.prototype);
//
///**
// * List commits by username, repo, branch and path
// * http://develop.github.com/p/commits.html#listing_commits_for_a_file
// *
// * @param {String} username the username
// * @param {String} repo the repo
// * @param {String} $branch the branch
// * @param {String} $path the path
// * @return array list of users found
// */
//this.getFileCommits = function(username, repo, $branch, $path, callback)
//{
// $response = $this->api->get('commits/list/'.urlencode(username).'/'.urlencode(repo).'/'.urlencode($branch).'/'.urlencode($path));
//
// return $response['commits'];
//}