From 203b04aad351d1306ddc1ecb7525769fe8456a75 Mon Sep 17 00:00:00 2001 From: witjem Date: Tue, 2 Jul 2019 14:31:38 +0300 Subject: [PATCH] Add params 'path' and 'name' for create fork --- src/main/java/org/gitlab/api/GitlabAPI.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gitlab/api/GitlabAPI.java b/src/main/java/org/gitlab/api/GitlabAPI.java index c8770ec1..c57e5b7d 100644 --- a/src/main/java/org/gitlab/api/GitlabAPI.java +++ b/src/main/java/org/gitlab/api/GitlabAPI.java @@ -1316,16 +1316,30 @@ public GitlabProject createUserProject(Integer userId, String name, String descr /** * @param namespace The namespace of the fork * @param projectId ProjectId of the project forked + * @param path The path that will be assigned to the resultant project after forking. (Optional) + * @param name The name that will be assigned to the resultant project after forking. (Optional) * @return The new Gitlab Project * @throws IOException on gitlab api call error */ - public GitlabProject createFork(String namespace, Integer projectId) throws IOException { + public GitlabProject createFork(String namespace, Integer projectId, String path, String name) throws IOException { Query query = new Query() - .appendIf("namespace", namespace); + .appendIf("namespace", namespace) + .appendIf("path", path) + .appendIf("name", name); String tailUrl = GitlabProject.URL + "/" + projectId + "/fork" + query.toString(); return dispatch().to(tailUrl, GitlabProject.class); } + /** + * @param namespace The namespace of the fork + * @param projectId ProjectId of the project forked + * @return The new Gitlab Project + * @throws IOException on gitlab api call error + */ + public GitlabProject createFork(String namespace, Integer projectId) throws IOException { + return createFork(namespace, projectId, null, null); + } + /** * @param namespace The namespace of the fork * @param gitlabProject The project forked