()
| 85 | } |
| 86 | |
| 87 | func (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>. |
no test coverage detected