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 8 months ago
6543 commented 8 months ago
Collaborator

as title

as title
6543 added this to the v0.14.0 milestone 8 months ago
6543 added the
kind/enhancement
label 8 months ago
6543 added 3 commits 8 months ago
noerw reviewed 8 months ago
Dismissed
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 {
noerw commented 8 months ago
Poster

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

Move the version check into fixPullHeadSha, so it's selfdocumenting?
noerw commented 8 months ago
Poster

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?
6543 commented 8 months ago
Poster
Collaborator

@noerw done

@noerw done
6543 marked this conversation as resolved
6543 added 1 commit 8 months ago
ae05111399
relax test data
6543 added 1 commit 8 months ago
6543 added 1 commit 8 months ago
0cedeb440e
add "This is fixed for gitea >= 1.14.0"
noerw approved these changes 8 months ago
Dismissed
zeripath approved these changes 8 months ago
Dismissed
zeripath merged commit e0cf20a456 into master 8 months ago
6543 deleted branch fix-empty-pull-head-sha 8 months ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as e0cf20a456.
Sign in to join this conversation.
Loading…
There is no content yet.