peter-murach/github — Issue #8: Pagination broken for Commits?
Author: ledbettj
Created: 2012-01-19 18:40:56+00:00
State: open

Hi Peter,

This is a great gem -- nice work. I've run into one issue with the pagination: It seems to work fine when I use it for e.g. listing repositories for a user, but when trying to retrieve commits it doesn't seem to be working properly.

> api = Github.new(:oauth_token => '....')
> commits = api.repos.commits('ledbettj', 'cnote', :per_page => 30)
> commits[0].sha
"b05792d6f414006d3944d547829e760d3e3f1cb9"
> commits.has_next_page?
true
> commits = commits.next_page
> commits[0].sha
"b05792d6f414006d3944d547829e760d3e3f1cb9"

From the debug output, It looks like it is always requesting page 1: `get https://api.github.com/repos/ledbettj/cnote/commits?page=1&per_page=30`

Let me know if you need any additional info!