Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions src/main/java/org/gitlab/api/GitlabAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -1301,9 +1301,8 @@ public GitlabProject createUserProject(Integer userId, String name, String descr
*/
public GitlabProject createFork(String namespace, Integer projectId) throws IOException {
Query query = new Query()
.appendIf("id", projectId)
.append("namespace", namespace);
String tailUrl = GitlabProject.URL + "/" + projectId + "/fork";
.appendIf("namespace", namespace);
String tailUrl = GitlabProject.URL + "/" + projectId + "/fork" + query.toString();
return dispatch().to(tailUrl, GitlabProject.class);
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/gitlab/api/models/GitlabProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ public class GitlabProject {
@JsonProperty("is_printing_merge_request_link_enabled")
private Boolean printingMergeRequestLinkEnabled;

@JsonProperty("import_status")
private String importStatus;

public Integer getId() {
return id;
}
Expand Down
5 changes: 4 additions & 1 deletion src/test/java/org/gitlab/api/GitlabAPIIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,14 @@ public void testCreateDeleteFork() throws Exception {
false,
false);

String namespace = api.getNamespaces().get(0).getPath();

GitlabProject project = api.createUserProject(gitUser.getId(), projectName);
GitlabProject fork = api.createFork(api.getNamespaces().get(0).getPath(), project);
GitlabProject fork = api.createFork(namespace, project);

assertNotNull(fork);
assertEquals(project.getId(), fork.getForkedFrom().getId());
assertEquals(project.getNamespace(), namespace);

api.deleteProject(project.getId());
api.deleteProject(fork.getId());
Expand Down