@@ -7,9 +7,8 @@ package github
7
7
8
8
import (
9
9
"context"
10
- "fmt"
11
-
12
10
"encoding/json"
11
+ "fmt"
13
12
)
14
13
15
14
// RepositoryListForksOptions specifies the optional parameters to the
@@ -53,9 +52,9 @@ func (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string,
53
52
// RepositoriesService.CreateFork method.
54
53
type RepositoryCreateForkOptions struct {
55
54
// The organization to fork the repository into.
56
- Organization string `url :"organization,omitempty"`
57
- Name string `url :"name,omitempty"`
58
- DefaultBranchOnly bool `url :"default_branch_only,omitempty"`
55
+ Organization string `json :"organization,omitempty"`
56
+ Name string `json :"name,omitempty"`
57
+ DefaultBranchOnly bool `json :"default_branch_only,omitempty"`
59
58
}
60
59
61
60
// CreateFork creates a fork of the specified repository.
@@ -70,12 +69,8 @@ type RepositoryCreateForkOptions struct {
70
69
// GitHub API docs: https://docs.github.com/en/rest/repos/forks#create-a-fork
71
70
func (s * RepositoriesService ) CreateFork (ctx context.Context , owner , repo string , opts * RepositoryCreateForkOptions ) (* Repository , * Response , error ) {
72
71
u := fmt .Sprintf ("repos/%v/%v/forks" , owner , repo )
73
- u , err := addOptions (u , opts )
74
- if err != nil {
75
- return nil , nil , err
76
- }
77
72
78
- req , err := s .client .NewRequest ("POST" , u , nil )
73
+ req , err := s .client .NewRequest ("POST" , u , opts )
79
74
if err != nil {
80
75
return nil , nil , err
81
76
}
0 commit comments