Commit f6833a4b authored by Greg Messner's avatar Greg Messner
Browse files

Now URL encodes the sha when fetching a single commit (#328).

parent fa03dbd2
...@@ -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>>(){}));
} }
......
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