Commit 2aa68d2f authored by khvalIvan's avatar khvalIvan Committed by Greg Messner
Browse files

"ref_name" was changed to "ref" in APIv4 (#108)

https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/repositories.md - optional "ref_name" for V3
https://docs.gitlab.com/ce/api/repositories.html - optional "ref" for V4
parent d6d6ba16
...@@ -357,7 +357,7 @@ public class RepositoryApi extends AbstractApi { ...@@ -357,7 +357,7 @@ public class RepositoryApi extends AbstractApi {
Form formData = new GitLabApiForm() Form formData = new GitLabApiForm()
.withParam("id", projectId, true) .withParam("id", projectId, true)
.withParam("path", filePath, false) .withParam("path", filePath, false)
.withParam("ref_name", refName, false) .withParam(isApiVersion(ApiVersion.V3) ? "ref_name" : "ref", refName, false)
.withParam("recursive", recursive, false) .withParam("recursive", recursive, false)
.withParam(PER_PAGE_PARAM, getDefaultPerPage()); .withParam(PER_PAGE_PARAM, getDefaultPerPage());
Response response = get(Response.Status.OK, formData.asMap(), "projects", projectId, "repository", "tree"); Response response = get(Response.Status.OK, formData.asMap(), "projects", projectId, "repository", "tree");
...@@ -386,7 +386,7 @@ public class RepositoryApi extends AbstractApi { ...@@ -386,7 +386,7 @@ public class RepositoryApi extends AbstractApi {
Form formData = new GitLabApiForm() Form formData = new GitLabApiForm()
.withParam("id", projectId, true) .withParam("id", projectId, true)
.withParam("path", filePath, false) .withParam("path", filePath, false)
.withParam("ref_name", refName, false) .withParam(isApiVersion(ApiVersion.V3) ? "ref_name" : "ref", refName, false)
.withParam("recursive", recursive, false); .withParam("recursive", recursive, false);
return (new Pager<TreeItem>(this, TreeItem.class, itemsPerPage, formData.asMap(), "projects", projectId, "repository", "tree")); return (new Pager<TreeItem>(this, TreeItem.class, itemsPerPage, formData.asMap(), "projects", projectId, "repository", "tree"));
} }
......
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