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
26ea551e
Commit
26ea551e
authored
May 30, 2018
by
JB Sazon
Committed by
Sander van Harmelen
May 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add merge method constants (#410)
parent
72694947
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
gitlab.go
gitlab.go
+22
-0
projects.go
projects.go
+1
-1
projects_test.go
projects_test.go
+4
-1
No files found.
gitlab.go
View file @
26ea551e
...
@@ -213,6 +213,20 @@ const (
...
@@ -213,6 +213,20 @@ const (
PublicVisibility
VisibilityValue
=
"public"
PublicVisibility
VisibilityValue
=
"public"
)
)
// MergeMethodValue represents a project merge type within GitLab.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#project-merge-method
type
MergeMethodValue
string
// List of available merge type
//
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#project-merge-method
const
(
NoFastForwardMerge
MergeMethodValue
=
"merge"
FastForwardMerge
MergeMethodValue
=
"ff"
RebaseMerge
MergeMethodValue
=
"rebase_merge"
)
// EventTypeValue represents actions type for contribution events
// EventTypeValue represents actions type for contribution events
type
EventTypeValue
string
type
EventTypeValue
string
...
@@ -830,3 +844,11 @@ func Visibility(v VisibilityValue) *VisibilityValue {
...
@@ -830,3 +844,11 @@ func Visibility(v VisibilityValue) *VisibilityValue {
*
p
=
v
*
p
=
v
return
p
return
p
}
}
// MergeMethod is a helper routine that allocates a new MergeMethod
// to sotre v and returns a pointer to it.
func
MergeMethod
(
v
MergeMethodValue
)
*
MergeMethodValue
{
p
:=
new
(
MergeMethodValue
)
*
p
=
v
return
p
}
projects.go
View file @
26ea551e
...
@@ -391,7 +391,7 @@ type CreateProjectOptions struct {
...
@@ -391,7 +391,7 @@ type CreateProjectOptions struct {
PublicJobs
*
bool
`url:"public_jobs,omitempty" json:"public_jobs,omitempty"`
PublicJobs
*
bool
`url:"public_jobs,omitempty" json:"public_jobs,omitempty"`
OnlyAllowMergeIfPipelineSucceeds
*
bool
`url:"only_allow_merge_if_pipeline_succeeds,omitempty" json:"only_allow_merge_if_pipeline_succeeds,omitempty"`
OnlyAllowMergeIfPipelineSucceeds
*
bool
`url:"only_allow_merge_if_pipeline_succeeds,omitempty" json:"only_allow_merge_if_pipeline_succeeds,omitempty"`
OnlyAllowMergeIfAllDiscussionsAreResolved
*
bool
`url:"only_allow_merge_if_all_discussions_are_resolved,omitempty" json:"only_allow_merge_if_all_discussions_are_resolved,omitempty"`
OnlyAllowMergeIfAllDiscussionsAreResolved
*
bool
`url:"only_allow_merge_if_all_discussions_are_resolved,omitempty" json:"only_allow_merge_if_all_discussions_are_resolved,omitempty"`
MergeMethod
*
string
`url:"merge_method,omitempty" json:"merge_method,omitempty"`
MergeMethod
*
MergeMethodValue
`url:"merge_method,omitempty" json:"merge_method,omitempty"`
LFSEnabled
*
bool
`url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
LFSEnabled
*
bool
`url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
RequestAccessEnabled
*
bool
`url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
RequestAccessEnabled
*
bool
`url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
TagList
*
[]
string
`url:"tag_list,omitempty" json:"tag_list,omitempty"`
TagList
*
[]
string
`url:"tag_list,omitempty" json:"tag_list,omitempty"`
...
...
projects_test.go
View file @
26ea551e
...
@@ -234,7 +234,10 @@ func TestCreateProject(t *testing.T) {
...
@@ -234,7 +234,10 @@ func TestCreateProject(t *testing.T) {
fmt
.
Fprint
(
w
,
`{"id":1}`
)
fmt
.
Fprint
(
w
,
`{"id":1}`
)
})
})
opt
:=
&
CreateProjectOptions
{
Name
:
String
(
"n"
)}
opt
:=
&
CreateProjectOptions
{
Name
:
String
(
"n"
),
MergeMethod
:
MergeMethod
(
RebaseMerge
),
}
project
,
_
,
err
:=
client
.
Projects
.
CreateProject
(
opt
)
project
,
_
,
err
:=
client
.
Projects
.
CreateProject
(
opt
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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