Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
2450d70d
Commit
2450d70d
authored
Jun 16, 2017
by
Greg Messner
Browse files
Updated getCommits() to set per_page to DEFAULT_PER_PAGE.
parent
971a4f39
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/CommitsApi.java
View file @
2450d70d
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
));
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment