Skip to content

Commit cd52f00

Browse files
committed
Add Ref to Issue structs (#466)
Add Ref to Issue structs Add TEST Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/466 Reviewed-by: Andrew Thornton <[email protected]> Reviewed-by: Norwin <[email protected]> Co-Authored-By: 6543 <[email protected]> Co-Committed-By: 6543 <[email protected]>
1 parent 68eec69 commit cd52f00

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

gitea/issue.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type Issue struct {
3939
OriginalAuthorID int64 `json:"original_author_id"`
4040
Title string `json:"title"`
4141
Body string `json:"body"`
42+
Ref string `json:"ref"`
4243
Labels []*Label `json:"labels"`
4344
Milestone *Milestone `json:"milestone"`
4445
// deprecated
@@ -173,7 +174,9 @@ func (c *Client) GetIssue(owner, repo string, index int64) (*Issue, *Response, e
173174
type CreateIssueOption struct {
174175
Title string `json:"title"`
175176
Body string `json:"body"`
176-
// username of assignee
177+
Ref string `json:"ref"`
178+
// deprecated
179+
// TODO: rm on sdk 0.15.0
177180
Assignee string `json:"assignee"`
178181
Assignees []string `json:"assignees"`
179182
Deadline *time.Time `json:"due_date"`
@@ -210,8 +213,11 @@ func (c *Client) CreateIssue(owner, repo string, opt CreateIssueOption) (*Issue,
210213

211214
// EditIssueOption options for editing an issue
212215
type EditIssueOption struct {
213-
Title string `json:"title"`
214-
Body *string `json:"body"`
216+
Title string `json:"title"`
217+
Body *string `json:"body"`
218+
Ref *string `json:"ref"`
219+
// deprecated
220+
// TODO: rm on sdk 0.15.0
215221
Assignee *string `json:"assignee"`
216222
Assignees []string `json:"assignees"`
217223
Milestone *int64 `json:"milestone"`

gitea/issue_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ func editIssues(t *testing.T, c *Client) {
5959
Title: "Edited",
6060
Body: OptionalString("123 test and go"),
6161
State: &state,
62+
Ref: OptionalString("master"),
6263
})
6364
assert.NoError(t, err)
6465
assert.EqualValues(t, issue.ID, issueNew.ID)
6566
assert.EqualValues(t, "123 test and go", issueNew.Body)
6667
assert.EqualValues(t, "Edited", issueNew.Title)
68+
assert.EqualValues(t, "master", issueNew.Ref)
6769
}
6870

6971
func listIssues(t *testing.T, c *Client) {

0 commit comments

Comments
 (0)