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

Method repository

acceptance/fixture_repository_test.go:118–135  ·  view source on GitHub ↗
(mode string)

Source from the content-addressed store, hash-verified

116}
117
118func (m *fixtureRepositoryManager) repository(mode string) (string, error) {
119 m.mu.Lock()
120 defer m.mu.Unlock()
121
122 if mode == "shared" && m.shared != "" {
123 return m.shared, nil
124 }
125
126 name := fmt.Sprintf("gh-acceptance-%s-%s", mode, strings.ToLower(randomString(16)))
127 m.repositories = append(m.repositories, name)
128 if err := m.client.create(name); err != nil {
129 return "", fmt.Errorf("creating %s fixture repository: %w", mode, err)
130 }
131 if mode == "shared" {
132 m.shared = name
133 }
134 return name, nil
135}
136
137func (m *fixtureRepositoryManager) cleanup() error {
138 m.mu.Lock()

Callers 3

sharedCmdsFunction · 0.80

Calls 3

randomStringFunction · 0.85
createMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected