Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
3ee60e77
Commit
3ee60e77
authored
May 18, 2019
by
Pablo Carranza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Fork Project Options
parent
ddb4d033
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
projects.go
projects.go
+11
-2
No files found.
projects.go
View file @
3ee60e77
...
@@ -557,18 +557,27 @@ func (s *ProjectsService) EditProject(pid interface{}, opt *EditProjectOptions,
...
@@ -557,18 +557,27 @@ func (s *ProjectsService) EditProject(pid interface{}, opt *EditProjectOptions,
return
p
,
resp
,
err
return
p
,
resp
,
err
}
}
// ForkProjectOptions represents the available ForkProject() options.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#fork-project
type
ForkProjectOptions
struct
{
Namespace
*
string
`url:"namespace,omitempty" json:"namespace,omitempty"`
Name
*
string
`url:"name,omitempty" json:"name,omitempty" `
Path
*
string
`url:"path,omitempty" json:"path,omitempty"`
}
// ForkProject forks a project into the user namespace of the authenticated
// ForkProject forks a project into the user namespace of the authenticated
// user.
// user.
//
//
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#fork-project
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#fork-project
func
(
s
*
ProjectsService
)
ForkProject
(
pid
interface
{},
options
...
OptionFunc
)
(
*
Project
,
*
Response
,
error
)
{
func
(
s
*
ProjectsService
)
ForkProject
(
pid
interface
{},
opt
*
ForkProjectOptions
,
opt
ions
...
OptionFunc
)
(
*
Project
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
err
return
nil
,
nil
,
err
}
}
u
:=
fmt
.
Sprintf
(
"projects/%s/fork"
,
pathEscape
(
project
))
u
:=
fmt
.
Sprintf
(
"projects/%s/fork"
,
pathEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"POST"
,
u
,
nil
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"POST"
,
u
,
opt
,
options
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
err
return
nil
,
nil
,
err
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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