Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
dce1deb9
Commit
dce1deb9
authored
Dec 04, 2017
by
Greg Messner
Browse files
forkProject() now looks for CREATED status (#107).
parent
5e7248d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ProjectApi.java
View file @
dce1deb9
...
@@ -832,6 +832,8 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -832,6 +832,8 @@ public class ProjectApi extends AbstractApi implements Constants {
/**
/**
* Forks a project into the user namespace of the authenticated user or the one provided.
* Forks a project into the user namespace of the authenticated user or the one provided.
* The forking operation for a project is asynchronous and is completed in a background job.
* The request will return immediately.
*
*
* POST /projects/:id/fork
* POST /projects/:id/fork
*
*
...
@@ -841,11 +843,14 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -841,11 +843,14 @@ public class ProjectApi extends AbstractApi implements Constants {
*/
*/
public
void
forkProject
(
Integer
id
,
String
namespace
)
throws
GitLabApiException
{
public
void
forkProject
(
Integer
id
,
String
namespace
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
new
GitLabApiForm
().
withParam
(
"namespace"
,
namespace
,
true
);
GitLabApiForm
formData
=
new
GitLabApiForm
().
withParam
(
"namespace"
,
namespace
,
true
);
post
(
Response
.
Status
.
OK
,
formData
,
"projects"
,
id
,
"fork"
);
Response
.
Status
expectedStatus
=
(
isApiVersion
(
ApiVersion
.
V3
)
?
Response
.
Status
.
OK
:
Response
.
Status
.
NO_CONTENT
);
post
(
expectedStatus
,
formData
,
"projects"
,
id
,
"fork"
);
}
}
/**
/**
* Forks a project into the user namespace of the authenticated user or the one provided.
* Forks a project into the user namespace of the authenticated user or the one provided.
* The forking operation for a project is asynchronous and is completed in a background job.
* The request will return immediately.
*
*
* POST /projects/:id/fork
* POST /projects/:id/fork
*
*
...
@@ -859,6 +864,8 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -859,6 +864,8 @@ public class ProjectApi extends AbstractApi implements Constants {
/**
/**
* Forks a project into the user namespace of the authenticated user or the one provided.
* Forks a project into the user namespace of the authenticated user or the one provided.
* The forking operation for a project is asynchronous and is completed in a background job.
* The request will return immediately.
*
*
* POST /projects/:id/fork
* POST /projects/:id/fork
*
*
...
@@ -868,11 +875,14 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -868,11 +875,14 @@ public class ProjectApi extends AbstractApi implements Constants {
*/
*/
public
void
forkProject
(
Integer
id
,
Integer
namespaceId
)
throws
GitLabApiException
{
public
void
forkProject
(
Integer
id
,
Integer
namespaceId
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
new
GitLabApiForm
().
withParam
(
"namespace"
,
namespaceId
,
true
);
GitLabApiForm
formData
=
new
GitLabApiForm
().
withParam
(
"namespace"
,
namespaceId
,
true
);
post
(
Response
.
Status
.
OK
,
formData
,
"projects"
,
id
,
"fork"
);
Response
.
Status
expectedStatus
=
(
isApiVersion
(
ApiVersion
.
V3
)
?
Response
.
Status
.
OK
:
Response
.
Status
.
NO_CONTENT
);
post
(
expectedStatus
,
formData
,
"projects"
,
id
,
"fork"
);
}
}
/**
/**
* Forks a project into the user namespace of the authenticated user or the one provided.
* Forks a project into the user namespace of the authenticated user or the one provided.
* The forking operation for a project is asynchronous and is completed in a background job.
* The request will return immediately.
*
*
* POST /projects/:id/fork
* POST /projects/:id/fork
*
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment