Commit 2450d70d authored by Greg Messner's avatar Greg Messner
Browse files

Updated getCommits() to set per_page to DEFAULT_PER_PAGE.

parent 971a4f39
package org.gitlab4j.api; package org.gitlab4j.api;
import javax.ws.rs.core.Form;
import javax.ws.rs.core.GenericType; import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
...@@ -27,7 +28,8 @@ public class CommitsApi extends AbstractApi { ...@@ -27,7 +28,8 @@ public class CommitsApi extends AbstractApi {
* @throws GitLabApiException GitLabApiException if any exception occurs during execution * @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/ */
public List<Commit> getCommits(int projectId) throws GitLabApiException { public List<Commit> getCommits(int projectId) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", projectId, "repository", "commits"); Form formData = new GitLabApiForm().withParam("per_page", getDefaultPerPage());
Response response = get(Response.Status.OK, formData.asMap(), "projects", projectId, "repository", "commits");
return (response.readEntity(new GenericType<List<Commit>>() { return (response.readEntity(new GenericType<List<Commit>>() {
})); }));
} }
...@@ -43,7 +45,8 @@ public class CommitsApi extends AbstractApi { ...@@ -43,7 +45,8 @@ public class CommitsApi extends AbstractApi {
* @throws GitLabApiException GitLabApiException if any exception occurs during execution * @throws GitLabApiException GitLabApiException if any exception occurs during execution
*/ */
public Commit getCommits(int projectId, String sha) throws GitLabApiException { public Commit getCommits(int projectId, String sha) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", projectId, "repository", "commits", sha); Form formData = new GitLabApiForm().withParam("per_page", getDefaultPerPage());
Response response = get(Response.Status.OK, formData.asMap(), "projects", projectId, "repository", "commits", sha);
return (response.readEntity(Commit.class)); return (response.readEntity(Commit.class));
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment