diff --git a/gitea/issue.go b/gitea/issue.go index 0b0824f..185192a 100644 --- a/gitea/issue.go +++ b/gitea/issue.go @@ -39,6 +39,7 @@ type Issue struct { OriginalAuthorID int64 `json:"original_author_id"` Title string `json:"title"` Body string `json:"body"` + Ref string `json:"ref"` Labels []*Label `json:"labels"` Milestone *Milestone `json:"milestone"` // deprecated @@ -173,7 +174,9 @@ func (c *Client) GetIssue(owner, repo string, index int64) (*Issue, *Response, e type CreateIssueOption struct { Title string `json:"title"` Body string `json:"body"` - // username of assignee + Ref string `json:"ref"` + // deprecated + // TODO: rm on sdk 0.15.0 Assignee string `json:"assignee"` Assignees []string `json:"assignees"` Deadline *time.Time `json:"due_date"` @@ -210,8 +213,11 @@ func (c *Client) CreateIssue(owner, repo string, opt CreateIssueOption) (*Issue, // EditIssueOption options for editing an issue type EditIssueOption struct { - Title string `json:"title"` - Body *string `json:"body"` + Title string `json:"title"` + Body *string `json:"body"` + Ref *string `json:"ref"` + // deprecated + // TODO: rm on sdk 0.15.0 Assignee *string `json:"assignee"` Assignees []string `json:"assignees"` Milestone *int64 `json:"milestone"` diff --git a/gitea/issue_test.go b/gitea/issue_test.go index 547eef8..a9c7736 100644 --- a/gitea/issue_test.go +++ b/gitea/issue_test.go @@ -59,11 +59,13 @@ func editIssues(t *testing.T, c *Client) { Title: "Edited", Body: OptionalString("123 test and go"), State: &state, + Ref: OptionalString("master"), }) assert.NoError(t, err) assert.EqualValues(t, issue.ID, issueNew.ID) assert.EqualValues(t, "123 test and go", issueNew.Body) assert.EqualValues(t, "Edited", issueNew.Title) + assert.EqualValues(t, "master", issueNew.Ref) } func listIssues(t *testing.T, c *Client) {