MCPcopy Create free account
hub / github.com/gogs/gogs / readAddress

Method readAddress

internal/database/mirror.go:87–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85}
86
87func (m *Mirror) readAddress() {
88 if len(m.address) > 0 {
89 return
90 }
91
92 cfg, err := ini.LoadSources(
93 ini.LoadOptions{IgnoreInlineComment: true},
94 m.Repo.GitConfigPath(),
95 )
96 if err != nil {
97 log.Error("load config: %v", err)
98 return
99 }
100 m.address = cfg.Section("remote \"origin\"").Key("url").Value()
101}
102
103// HandleMirrorCredentials replaces user credentials from HTTP/HTTPS URL
104// with placeholder <credentials>.

Callers 3

AddressMethod · 0.95
MosaicsAddressMethod · 0.95
RawAddressMethod · 0.95

Calls 3

GitConfigPathMethod · 0.80
ValueMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected