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
f6833a4b
Commit
f6833a4b
authored
Apr 09, 2019
by
Greg Messner
Browse files
Now URL encodes the sha when fetching a single commit (#328).
parent
fa03dbd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/CommitsApi.java
View file @
f6833a4b
...
@@ -262,7 +262,7 @@ public class CommitsApi extends AbstractApi {
...
@@ -262,7 +262,7 @@ 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
getCommit
(
Object
projectIdOrPath
,
String
sha
)
throws
GitLabApiException
{
public
Commit
getCommit
(
Object
projectIdOrPath
,
String
sha
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getDefaultPerPageParam
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"repository"
,
"commits"
,
sha
);
Response
response
=
get
(
Response
.
Status
.
OK
,
getDefaultPerPageParam
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"repository"
,
"commits"
,
urlEncode
(
sha
)
)
;
return
(
response
.
readEntity
(
Commit
.
class
));
return
(
response
.
readEntity
(
Commit
.
class
));
}
}
...
@@ -314,7 +314,7 @@ public class CommitsApi extends AbstractApi {
...
@@ -314,7 +314,7 @@ public class CommitsApi extends AbstractApi {
Form
form
=
new
GitLabApiForm
()
Form
form
=
new
GitLabApiForm
()
.
withParam
(
"type"
,
refType
)
.
withParam
(
"type"
,
refType
)
.
withParam
(
PER_PAGE_PARAM
,
getDefaultPerPage
());
.
withParam
(
PER_PAGE_PARAM
,
getDefaultPerPage
());
Response
response
=
get
(
Response
.
Status
.
OK
,
form
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"repository"
,
"commits"
,
sha
,
"refs"
);
Response
response
=
get
(
Response
.
Status
.
OK
,
form
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"repository"
,
"commits"
,
urlEncode
(
sha
)
,
"refs"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
CommitRef
>>(){}));
return
(
response
.
readEntity
(
new
GenericType
<
List
<
CommitRef
>>(){}));
}
}
...
...
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