MCPcopy Index your code
hub / github.com/git-bug/git-bug / loadConfig

Function loadConfig

bridge/core/bridge.go:263–278  ·  view source on GitHub ↗
(repo repository.RepoConfig, name string)

Source from the content-addressed store, hash-verified

261}
262
263func loadConfig(repo repository.RepoConfig, name string) (Configuration, error) {
264 keyPrefix := fmt.Sprintf("git-bug.bridge.%s.", name)
265
266 pairs, err := repo.LocalConfig().ReadAll(keyPrefix)
267 if err != nil {
268 return nil, errors.Wrap(err, "error while reading bridge configuration")
269 }
270
271 result := make(Configuration, len(pairs))
272 for key, value := range pairs {
273 key := strings.TrimPrefix(key, keyPrefix)
274 result[key] = value
275 }
276
277 return result, nil
278}
279
280func (b *Bridge) getImporter() Importer {
281 if b.importer == nil {

Callers 2

LoadBridgeFunction · 0.85
ensureConfigMethod · 0.85

Calls 2

ReadAllMethod · 0.65
LocalConfigMethod · 0.65

Tested by

no test coverage detected