这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

#122 Added pagination support for repo.commits. #145

Merged
merged 3 commits into from
Oct 7, 2014
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
8 changes: 5 additions & 3 deletions lib/octonode/repo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/octonode/repo.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ class Repo

# Get the commits for a repository
# '/repos/pksunkara/hub/commits' GET
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add the comments here?

   # - page or query object, optional - params[0]
   # - per_page, optional             - params[1]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing.

commits: (cb) ->
@client.get "/repos/#{@name}/commits", (err, s, b, h) ->
# - page or query object, optional - params[0]
# - per_page, optional - params[1]
commits: (params..., cb) ->
@client.get "/repos/#{@name}/commits", params..., (err, s, b, h) ->
return cb(err) if err
if s isnt 200 then cb(new Error("Repo commits error")) else cb null, b, h

Expand Down