Skip to content

Commit 8695064

Browse files
witjemtimols
authored andcommitted
Add params 'path' and 'name' for create fork (timols#354)
1 parent e46d665 commit 8695064

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/main/java/org/gitlab/api/GitlabAPI.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,16 +1339,30 @@ public GitlabProject createUserProject(Integer userId, String name, String descr
13391339
/**
13401340
* @param namespace The namespace of the fork
13411341
* @param projectId ProjectId of the project forked
1342+
* @param path The path that will be assigned to the resultant project after forking. (Optional)
1343+
* @param name The name that will be assigned to the resultant project after forking. (Optional)
13421344
* @return The new Gitlab Project
13431345
* @throws IOException on gitlab api call error
13441346
*/
1345-
public GitlabProject createFork(String namespace, Integer projectId) throws IOException {
1347+
public GitlabProject createFork(String namespace, Integer projectId, String path, String name) throws IOException {
13461348
Query query = new Query()
1347-
.appendIf("namespace", namespace);
1349+
.appendIf("namespace", namespace)
1350+
.appendIf("path", path)
1351+
.appendIf("name", name);
13481352
String tailUrl = GitlabProject.URL + "/" + projectId + "/fork" + query.toString();
13491353
return dispatch().to(tailUrl, GitlabProject.class);
13501354
}
13511355

1356+
/**
1357+
* @param namespace The namespace of the fork
1358+
* @param projectId ProjectId of the project forked
1359+
* @return The new Gitlab Project
1360+
* @throws IOException on gitlab api call error
1361+
*/
1362+
public GitlabProject createFork(String namespace, Integer projectId) throws IOException {
1363+
return createFork(namespace, projectId, null, null);
1364+
}
1365+
13521366
/**
13531367
* @param namespace The namespace of the fork
13541368
* @param gitlabProject The project forked

0 commit comments

Comments
 (0)