Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/main/java/org/gitlab/api/GitlabAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down