|
@@ -121,13 +121,13 @@ func (m *Mirror) readAddress() {
|
|
|
log.Error(2, "Load: %v", err)
|
|
|
return
|
|
|
}
|
|
|
- m.address = unescapeMirrorCredentials(cfg.Section("remote \"origin\"").Key("url").Value())
|
|
|
+ m.address = cfg.Section("remote \"origin\"").Key("url").Value()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-func HandleCloneUserCredentials(url string, mosaics bool) string {
|
|
|
+
|
|
|
+func HandleMirrorCredentials(url string, mosaics bool) string {
|
|
|
i := strings.Index(url, "@")
|
|
|
if i == -1 {
|
|
|
return url
|
|
@@ -145,21 +145,27 @@ func HandleCloneUserCredentials(url string, mosaics bool) string {
|
|
|
|
|
|
func (m *Mirror) Address() string {
|
|
|
m.readAddress()
|
|
|
- return HandleCloneUserCredentials(m.address, false)
|
|
|
+ return HandleMirrorCredentials(m.address, false)
|
|
|
}
|
|
|
|
|
|
|
|
|
func (m *Mirror) MosaicsAddress() string {
|
|
|
m.readAddress()
|
|
|
- return HandleCloneUserCredentials(m.address, true)
|
|
|
+ return HandleMirrorCredentials(m.address, true)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-func (m *Mirror) FullAddress() string {
|
|
|
+
|
|
|
+func (m *Mirror) RawAddress() string {
|
|
|
m.readAddress()
|
|
|
return m.address
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+func (m *Mirror) FullAddress() string {
|
|
|
+ m.readAddress()
|
|
|
+ return unescapeMirrorCredentials(m.address)
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
func escapeMirrorCredentials(addr string) string {
|
|
|
start, end, found := findPasswordInMirrorAddress(addr)
|
|
@@ -191,7 +197,7 @@ func (m *Mirror) runSync() bool {
|
|
|
|
|
|
|
|
|
if !git.IsRepoURLAccessible(git.NetworkOptions{
|
|
|
- URL: m.FullAddress(),
|
|
|
+ URL: m.RawAddress(),
|
|
|
Timeout: 10 * time.Second,
|
|
|
}) {
|
|
|
desc := fmt.Sprintf("Source URL of mirror repository '%s' is not accessible: %s", m.Repo.FullName(), m.MosaicsAddress())
|