@@ -841,10 +841,11 @@ public void deleteProject(Project project) throws GitLabApiException {
841
841
* @param namespace path of the namespace that the project will be forked to
842
842
* @throws GitLabApiException if any exception occurs
843
843
*/
844
- public void forkProject (Integer id , String namespace ) throws GitLabApiException {
844
+ public Project forkProject (Integer id , String namespace ) throws GitLabApiException {
845
845
GitLabApiForm formData = new GitLabApiForm ().withParam ("namespace" , namespace , true );
846
- Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .NO_CONTENT );
847
- post (expectedStatus , formData , "projects" , id , "fork" );
846
+ Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .CREATED );
847
+ Response response = post (expectedStatus , formData , "projects" , id , "fork" );
848
+ return (response .readEntity (Project .class ));
848
849
}
849
850
850
851
/**
@@ -858,8 +859,8 @@ public void forkProject(Integer id, String namespace) throws GitLabApiException
858
859
* @param namespace path of the namespace that the project will be forked to
859
860
* @throws GitLabApiException if any exception occurs
860
861
*/
861
- public void forkProject (Project project , String namespace ) throws GitLabApiException {
862
- forkProject (project .getId (), namespace );
862
+ public Project forkProject (Project project , String namespace ) throws GitLabApiException {
863
+ return ( forkProject (project .getId (), namespace ) );
863
864
}
864
865
865
866
/**
@@ -873,10 +874,11 @@ public void forkProject(Project project, String namespace) throws GitLabApiExcep
873
874
* @param namespaceId ID of the namespace that the project will be forked to
874
875
* @throws GitLabApiException if any exception occurs
875
876
*/
876
- public void forkProject (Integer id , Integer namespaceId ) throws GitLabApiException {
877
+ public Project forkProject (Integer id , Integer namespaceId ) throws GitLabApiException {
877
878
GitLabApiForm formData = new GitLabApiForm ().withParam ("namespace" , namespaceId , true );
878
- Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .NO_CONTENT );
879
- post (expectedStatus , formData , "projects" , id , "fork" );
879
+ Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .CREATED );
880
+ Response response = post (expectedStatus , formData , "projects" , id , "fork" );
881
+ return (response .readEntity (Project .class ));
880
882
}
881
883
882
884
/**
@@ -890,8 +892,8 @@ public void forkProject(Integer id, Integer namespaceId) throws GitLabApiExcepti
890
892
* @param namespaceId ID of the namespace that the project will be forked to
891
893
* @throws GitLabApiException if any exception occurs
892
894
*/
893
- public void forkProject (Project project , Integer namespaceId ) throws GitLabApiException {
894
- forkProject (project .getId (), namespaceId );
895
+ public Project forkProject (Project project , Integer namespaceId ) throws GitLabApiException {
896
+ return ( forkProject (project .getId (), namespaceId ) );
895
897
}
896
898
897
899
/**
0 commit comments