diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 99b1979964..537ef71ccf 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -974,11 +974,11 @@ type remoteAddress struct { Password string } -func mirrorRemoteAddress(ctx context.Context, m *repo_model.Repository, remoteName string) remoteAddress { +func mirrorRemoteAddress(ctx context.Context, m *repo_model.Repository, remoteName string, ignoreOriginalURL bool) remoteAddress { a := remoteAddress{} remoteURL := m.OriginalURL - if remoteURL == "" { + if ignoreOriginalURL || remoteURL == "" { var err error remoteURL, err = git.GetRemoteAddress(ctx, m.RepoPath(), remoteName) if err != nil { diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 029e9a186f..94ae5ed7e2 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -38,7 +38,7 @@ {{if $.IsPullMirror}} - {{$address := MirrorRemoteAddress $.Context . $.Mirror.GetRemoteName}} + {{$address := MirrorRemoteAddress $.Context . $.Mirror.GetRemoteName false}}