Skip to content

Commit 2aa68d2

Browse files
khvalIvangmessner
authored andcommitted
"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
1 parent d6d6ba1 commit 2aa68d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/gitlab4j/api/RepositoryApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public List<TreeItem> getTree(Integer projectId, String filePath, String refName
357357
Form formData = new GitLabApiForm()
358358
.withParam("id", projectId, true)
359359
.withParam("path", filePath, false)
360-
.withParam("ref_name", refName, false)
360+
.withParam(isApiVersion(ApiVersion.V3) ? "ref_name" : "ref", refName, false)
361361
.withParam("recursive", recursive, false)
362362
.withParam(PER_PAGE_PARAM, getDefaultPerPage());
363363
Response response = get(Response.Status.OK, formData.asMap(), "projects", projectId, "repository", "tree");
@@ -386,7 +386,7 @@ public Pager<TreeItem> getTree(Integer projectId, String filePath, String refNam
386386
Form formData = new GitLabApiForm()
387387
.withParam("id", projectId, true)
388388
.withParam("path", filePath, false)
389-
.withParam("ref_name", refName, false)
389+
.withParam(isApiVersion(ApiVersion.V3) ? "ref_name" : "ref", refName, false)
390390
.withParam("recursive", recursive, false);
391391
return (new Pager<TreeItem>(this, TreeItem.class, itemsPerPage, formData.asMap(), "projects", projectId, "repository", "tree"));
392392
}

0 commit comments

Comments
 (0)