MCPcopy Create free account
hub / github.com/cli/cli / create

Method create

acceptance/fixture_repository_test.go:58–75  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

56}
57
58func (c *liveFixtureRepositoryClient) create(name string) error {
59 body, err := json.Marshal(struct {
60 Name string `json:"name"`
61 Private bool `json:"private"`
62 AutoInit bool `json:"auto_init"`
63 HasDiscussions bool `json:"has_discussions"`
64 }{
65 Name: name,
66 Private: true,
67 AutoInit: true,
68 HasDiscussions: true,
69 })
70 if err != nil {
71 return err
72 }
73 path := fmt.Sprintf("orgs/%s/repos", url.PathEscape(c.org))
74 return c.apiClient.Do(http.MethodPost, path, bytes.NewReader(body), nil)
75}
76
77func (c *liveFixtureRepositoryClient) delete(name string) error {
78 path := fmt.Sprintf("repos/%s/%s", url.PathEscape(c.org), url.PathEscape(name))

Callers

nothing calls this directly

Calls 1

DoMethod · 0.65

Tested by

no test coverage detected