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
114e2ebc
Commit
114e2ebc
authored
Apr 01, 2018
by
James Ramsay
Committed by
Sander van Harmelen
Apr 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ListOptions for paging GetCommitStatuses (#365)
parent
49516bf8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
commits.go
commits.go
+1
-0
commits_test.go
commits_test.go
+2
-2
No files found.
commits.go
View file @
114e2ebc
...
...
@@ -329,6 +329,7 @@ func (s *CommitsService) PostCommitComment(pid interface{}, sha string, opt *Pos
//
// GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#get-the-status-of-a-commit
type
GetCommitStatusesOptions
struct
{
ListOptions
Ref
*
string
`url:"ref,omitempty" json:"ref,omitempty"`
Stage
*
string
`url:"stage,omitempty" json:"stage,omitempty"`
Name
*
string
`url:"name,omitempty" json:"name,omitempty"`
...
...
commits_test.go
View file @
114e2ebc
...
...
@@ -16,7 +16,7 @@ func TestGetCommitStatuses(t *testing.T) {
fmt
.
Fprint
(
w
,
`[{"id":1}]`
)
})
opt
:=
&
GetCommitStatusesOptions
{
String
(
"master"
),
String
(
"test"
),
String
(
"ci/jenkins"
),
Bool
(
true
)}
opt
:=
&
GetCommitStatusesOptions
{
Ref
:
String
(
"master"
),
Stage
:
String
(
"test"
),
Name
:
String
(
"ci/jenkins"
),
All
:
Bool
(
true
)}
statuses
,
_
,
err
:=
client
.
Commits
.
GetCommitStatuses
(
"1"
,
"b0b3a907f41409829b307a28b82fdbd552ee5a27"
,
opt
)
if
err
!=
nil
{
...
...
@@ -38,7 +38,7 @@ func TestSetCommitStatus(t *testing.T) {
fmt
.
Fprint
(
w
,
`{"id":1}`
)
})
opt
:=
&
SetCommitStatusOptions
{
Running
,
String
(
"master"
),
String
(
"ci/jenkins"
),
String
(
""
),
String
(
"http://abc"
),
String
(
"build"
)}
opt
:=
&
SetCommitStatusOptions
{
State
:
Running
,
Ref
:
String
(
"master"
),
Name
:
String
(
"ci/jenkins"
),
Context
:
String
(
""
),
TargetURL
:
String
(
"http://abc"
),
Description
:
String
(
"build"
)}
status
,
_
,
err
:=
client
.
Commits
.
SetCommitStatus
(
"1"
,
"b0b3a907f41409829b307a28b82fdbd552ee5a27"
,
opt
)
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