Add workaround to get head branch sha of pulls with deleted head branch #498

Merged
zeripath merged 6 commits from 6543/go-sdk:fix-empty-pull-head-sha into master 2021-03-08 21:15:43 +00:00
Owner

as title

as title
6543 added this to the v0.14.0 milestone 2021-03-08 20:29:37 +00:00
6543 added the
kind/enhancement
label 2021-03-08 20:29:37 +00:00
6543 added 3 commits 2021-03-08 20:29:38 +00:00
noerw reviewed 2021-03-08 20:35:28 +00:00
Dismissed
@ -112,6 +119,11 @@ func (c *Client) ListRepoPullRequests(owner, repo string, opt ListPullRequestsOp
func (c *Client) GetPullRequest(owner, repo string, index int64) (*PullRequest, *Response, error) {
pr := new(PullRequest)
resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/pulls/%d", owner, repo, index), nil, nil, pr)
if c.checkServerVersionGreaterThanOrEqual(version1_14_0) != nil {
Member

Move the version check into fixPullHeadSha, so it's selfdocumenting?

Move the version check into fixPullHeadSha, so it's selfdocumenting?
Member

Scratch that, I see why you did that now.
Maybe add a comment to fixPullHeadSha instead about the affected gitea versions?

Scratch that, I see why you did that now. Maybe add a comment to `fixPullHeadSha` instead about the affected gitea versions?
Author
Owner

@noerw done

@noerw done
6543 marked this conversation as resolved
6543 added 1 commit 2021-03-08 20:37:19 +00:00
relax test data
Some checks failed
continuous-integration/drone/pr Build is failing
ae05111399
6543 added 1 commit 2021-03-08 20:43:17 +00:00
6543 added 1 commit 2021-03-08 20:45:42 +00:00
add "This is fixed for gitea >= 1.14.0"
All checks were successful
continuous-integration/drone/pr Build is passing
0cedeb440e
noerw approved these changes 2021-03-08 20:46:14 +00:00
Dismissed
zeripath approved these changes 2021-03-08 21:15:29 +00:00
Dismissed
zeripath merged commit e0cf20a456 into master 2021-03-08 21:15:42 +00:00
6543 deleted branch fix-empty-pull-head-sha 2021-03-08 21:18:26 +00:00
Sign in to join this conversation.
No description provided.