@@ -832,6 +832,8 @@ public void deleteProject(Project project) throws GitLabApiException {
832
832
833
833
/**
834
834
* Forks a project into the user namespace of the authenticated user or the one provided.
835
+ * The forking operation for a project is asynchronous and is completed in a background job.
836
+ * The request will return immediately.
835
837
*
836
838
* POST /projects/:id/fork
837
839
*
@@ -841,11 +843,14 @@ public void deleteProject(Project project) throws GitLabApiException {
841
843
*/
842
844
public void forkProject (Integer id , String namespace ) throws GitLabApiException {
843
845
GitLabApiForm formData = new GitLabApiForm ().withParam ("namespace" , namespace , true );
844
- post (Response .Status .OK , formData , "projects" , id , "fork" );
846
+ Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .NO_CONTENT );
847
+ post (expectedStatus , formData , "projects" , id , "fork" );
845
848
}
846
849
847
850
/**
848
851
* Forks a project into the user namespace of the authenticated user or the one provided.
852
+ * The forking operation for a project is asynchronous and is completed in a background job.
853
+ * The request will return immediately.
849
854
*
850
855
* POST /projects/:id/fork
851
856
*
@@ -859,6 +864,8 @@ public void forkProject(Project project, String namespace) throws GitLabApiExcep
859
864
860
865
/**
861
866
* Forks a project into the user namespace of the authenticated user or the one provided.
867
+ * The forking operation for a project is asynchronous and is completed in a background job.
868
+ * The request will return immediately.
862
869
*
863
870
* POST /projects/:id/fork
864
871
*
@@ -868,11 +875,14 @@ public void forkProject(Project project, String namespace) throws GitLabApiExcep
868
875
*/
869
876
public void forkProject (Integer id , Integer namespaceId ) throws GitLabApiException {
870
877
GitLabApiForm formData = new GitLabApiForm ().withParam ("namespace" , namespaceId , true );
871
- post (Response .Status .OK , formData , "projects" , id , "fork" );
878
+ Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .NO_CONTENT );
879
+ post (expectedStatus , formData , "projects" , id , "fork" );
872
880
}
873
881
874
882
/**
875
883
* Forks a project into the user namespace of the authenticated user or the one provided.
884
+ * The forking operation for a project is asynchronous and is completed in a background job.
885
+ * The request will return immediately.
876
886
*
877
887
* POST /projects/:id/fork
878
888
*
0 commit comments