GetPullRequestDiff: add PullRequestDiffOptions param #542

Merged
6543 merged 9 commits from noerw/go-sdk:add-binary-diff-opt into master 6 months ago
noerw commented 9 months ago
Collaborator

this is for the upstream change in https://github.com/go-gitea/gitea/pull/17158

this is for the upstream change in https://github.com/go-gitea/gitea/pull/17158
noerw added this to the v0.16.0 milestone 9 months ago
noerw added the
kind/breaking
kind/enhancement
labels 9 months ago
noerw added 1 commit 9 months ago
noerw added 1 commit 9 months ago
6c96bb4218 update tests
Owner

But we may have more options in future?

But we may have more options in future?
noerw added 1 commit 9 months ago
c8f8179c85 Merge branch 'master' into add-binary-diff-opt
6543 reviewed 6 months ago
gitea/pull.go Outdated
func (c *Client) GetPullRequestDiff(owner, repo string, index int64) ([]byte, *Response, error) {
return c.getPullRequestDiffOrPatch(owner, repo, "diff", index)
// GetPullRequestDiff gets the diff of a PR. For Gitea >= 1.16, you must set includeBinary to get an applicable diff
func (c *Client) GetPullRequestDiff(owner, repo string, index int64, includeBinary bool) ([]byte, *Response, error) {
6543 commented 6 months ago
Collaborator

breaking changes must be documented in migration howto

breaking changes must be documented in migration howto
noerw marked this conversation as resolved
noerw added 1 commit 6 months ago
9b8b3cf4d4 Merge branch 'master' into add-binary-diff-opt
noerw added 3 commits 6 months ago
noerw added 1 commit 6 months ago
904ee976e3 update test
noerw changed title from GetPullRequestDiff: add includeBinary option to GetPullRequestDiff: add PullRequestDiffOptios param 6 months ago
Poster
Collaborator

@6543 @lunny please rereview :)

@6543 @lunny please rereview :)
noerw added 1 commit 6 months ago
1653c52cb6 lint
noerw changed title from GetPullRequestDiff: add PullRequestDiffOptios param to GetPullRequestDiff: add PullRequestDiffOptions param 6 months ago
6543 reviewed 6 months ago
// PullRequestDiffOptions options for GET /repos/<owner>/<repo>/pulls/<idx>.[diff|patch]
type PullRequestDiffOptions struct {
// Include binary file changes when requesting a .diff
Binary bool
6543 commented 6 months ago
Collaborator

since this is optional and upstream default is true - we should change it to *bool type

since this is optional and upstream default is true - we should change it to `*bool` type
noerw commented 6 months ago
Poster
Collaborator

No, upstream default is false.

No, upstream default is false.
6543 marked this conversation as resolved
lunny approved these changes 6 months ago
6543 approved these changes 6 months ago
6543 merged commit 3ff2c60a86 into master 6 months ago
noerw deleted branch add-binary-diff-opt 6 months ago

Reviewers

lunny approved these changes 6 months ago
6543 approved these changes 6 months ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as 3ff2c60a86.
Sign in to join this conversation.
Loading…
There is no content yet.