"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/code.gitea.io/sdk/gitea/pull.go" between
gitea-1.13.1.tar.gz and gitea-1.13.2.tar.gz

About: Gitea allows to set up a self-hosted code hosting Git service (a fork of Gogs).

pull.go  (gitea-1.13.1):pull.go  (gitea-1.13.2)
skipping to change at line 163 skipping to change at line 163
State *StateType `json:"state"` State *StateType `json:"state"`
Deadline *time.Time `json:"due_date"` Deadline *time.Time `json:"due_date"`
} }
// Validate the EditPullRequestOption struct // Validate the EditPullRequestOption struct
func (opt EditPullRequestOption) Validate(c *Client) error { func (opt EditPullRequestOption) Validate(c *Client) error {
if len(opt.Title) != 0 && len(strings.TrimSpace(opt.Title)) == 0 { if len(opt.Title) != 0 && len(strings.TrimSpace(opt.Title)) == 0 {
return fmt.Errorf("title is empty") return fmt.Errorf("title is empty")
} }
if len(opt.Base) != 0 { if len(opt.Base) != 0 {
if err := c.CheckServerVersionConstraint(">=1.12.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_12_0); err != nil {
return fmt.Errorf("can not change base gitea to old") return fmt.Errorf("can not change base gitea to old")
} }
} }
return nil return nil
} }
// EditPullRequest modify pull request with PR id and options // EditPullRequest modify pull request with PR id and options
func (c *Client) EditPullRequest(owner, repo string, index int64, opt EditPullRe questOption) (*PullRequest, *Response, error) { func (c *Client) EditPullRequest(owner, repo string, index int64, opt EditPullRe questOption) (*PullRequest, *Response, error) {
if err := opt.Validate(c); err != nil { if err := opt.Validate(c); err != nil {
return nil, nil, err return nil, nil, err
skipping to change at line 232 skipping to change at line 232
if err != nil { if err != nil {
return false, resp, err return false, resp, err
} }
return status == 204, resp, nil return status == 204, resp, nil
} }
// getPullRequestDiffOrPatch gets the patch or diff file as bytes for a PR // getPullRequestDiffOrPatch gets the patch or diff file as bytes for a PR
func (c *Client) getPullRequestDiffOrPatch(owner, repo, kind string, index int64 ) ([]byte, *Response, error) { func (c *Client) getPullRequestDiffOrPatch(owner, repo, kind string, index int64 ) ([]byte, *Response, error) {
if err := c.CheckServerVersionConstraint(">=1.13.0"); err != nil { if err := c.checkServerVersionGreaterThanOrEqual(version1_13_0); err != n il {
r, _, err2 := c.GetRepo(owner, repo) r, _, err2 := c.GetRepo(owner, repo)
if err2 != nil { if err2 != nil {
return nil, nil, err return nil, nil, err
} }
if r.Private { if r.Private {
return nil, nil, err return nil, nil, err
} }
return c.getWebResponse("GET", fmt.Sprintf("/%s/%s/pulls/%d.%s", owner, repo, index, kind), nil) return c.getWebResponse("GET", fmt.Sprintf("/%s/%s/pulls/%d.%s", owner, repo, index, kind), nil)
} }
return c.getResponse("GET", fmt.Sprintf("/repos/%s/%s/pulls/%d.%s", owner , repo, index, kind), nil, nil) return c.getResponse("GET", fmt.Sprintf("/repos/%s/%s/pulls/%d.%s", owner , repo, index, kind), nil, nil)
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)