Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,11 @@ linters:
- PullRequestReviewDismissalRequest
- PullRequestReviewRequest
- PullRequestReviewsEnforcementUpdate
- RepoMergeUpstreamRequest
- Repository
- RepositoryAddCollaboratorOptions
- RepositoryComment
- RepositoryContentFileOptions
- RepositoryCreateForkOptions
- RepositoryMergeRequest
- RequiredStatusChecksRequest
- ReviewCustomDeploymentProtectionRuleRequest
- SCIMUserAttributes
Expand Down
18 changes: 9 additions & 9 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 3 additions & 12 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions github/repos_merging.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import (
// RepositoryMergeRequest represents a request to merge a branch in a
// repository.
type RepositoryMergeRequest struct {
Base *string `json:"base,omitempty"`
Head *string `json:"head,omitempty"`
Base string `json:"base"`
Head string `json:"head"`
CommitMessage *string `json:"commit_message,omitempty"`
}

// RepoMergeUpstreamRequest represents a request to sync a branch of
// a forked repository to keep it up-to-date with the upstream repository.
type RepoMergeUpstreamRequest struct {
Branch *string `json:"branch,omitempty"`
Branch string `json:"branch"`
}

// RepoMergeUpstreamResult represents the result of syncing a branch of
Expand All @@ -37,7 +37,7 @@ type RepoMergeUpstreamResult struct {
// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#merge-a-branch
//
//meta:operation POST /repos/{owner}/{repo}/merges
func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, body *RepositoryMergeRequest) (*RepositoryCommit, *Response, error) {
func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, body RepositoryMergeRequest) (*RepositoryCommit, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/merges", owner, repo)
req, err := s.client.NewRequest(ctx, "POST", u, body)
if err != nil {
Expand All @@ -59,7 +59,7 @@ func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, bod
// GitHub API docs: https://docs.github.com/rest/branches/branches?apiVersion=2022-11-28#sync-a-fork-branch-with-the-upstream-repository
//
//meta:operation POST /repos/{owner}/{repo}/merge-upstream
func (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo string, body *RepoMergeUpstreamRequest) (*RepoMergeUpstreamResult, *Response, error) {
func (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo string, body RepoMergeUpstreamRequest) (*RepoMergeUpstreamResult, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/merge-upstream", owner, repo)
req, err := s.client.NewRequest(ctx, "POST", u, body)
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions github/repos_merging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ func TestRepositoriesService_Merge(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

input := &RepositoryMergeRequest{
Base: Ptr("b"),
Head: Ptr("h"),
input := RepositoryMergeRequest{
Base: "b",
Head: "h",
CommitMessage: Ptr("c"),
}

Expand Down Expand Up @@ -59,8 +59,8 @@ func TestRepositoriesService_MergeUpstream(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

input := &RepoMergeUpstreamRequest{
Branch: Ptr("b"),
input := RepoMergeUpstreamRequest{
Branch: "b",
}

mux.HandleFunc("/repos/o/r/merge-upstream", func(w http.ResponseWriter, r *http.Request) {
Expand Down
Loading