diff options
author | Lee Tickett <lee@tickett.net> | 2019-08-29 19:19:07 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-08-29 19:19:07 +0300 |
commit | 72390953da802311180f53b6a646d80bc1da2849 (patch) | |
tree | 46d9baeab2c3ab91bca249c446b822b5dd956531 /app | |
parent | e6869b8f6c5a589cc9807e2a797599fb7a4a968e (diff) |
Handle invalid mirror url
Diffstat (limited to 'app')
-rw-r--r-- | app/models/remote_mirror.rb | 1 | ||||
-rw-r--r-- | app/views/projects/mirrors/_mirror_repos.html.haml | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/app/models/remote_mirror.rb b/app/models/remote_mirror.rb index c9ee0653d86..41e63986286 100644 --- a/app/models/remote_mirror.rb +++ b/app/models/remote_mirror.rb @@ -200,6 +200,7 @@ class RemoteMirror < ApplicationRecord result.password = '*****' if result.password result.user = '*****' if result.user && result.user != 'git' # tokens or other data may be saved as user result.to_s + rescue URI::Error end def ensure_remote! diff --git a/app/views/projects/mirrors/_mirror_repos.html.haml b/app/views/projects/mirrors/_mirror_repos.html.haml index 6f8a93fbcf5..84f0900d9c1 100644 --- a/app/views/projects/mirrors/_mirror_repos.html.haml +++ b/app/views/projects/mirrors/_mirror_repos.html.haml @@ -50,7 +50,7 @@ - @project.remote_mirrors.each_with_index do |mirror, index| - next if mirror.new_record? %tr.qa-mirrored-repository-row.rspec-mirrored-repository-row{ class: ('bg-secondary' if mirror.disabled?) } - %td.qa-mirror-repository-url= mirror.safe_url + %td.qa-mirror-repository-url= mirror.safe_url || _('Invalid URL') %td= _('Push') %td = mirror.last_update_started_at.present? ? time_ago_with_tooltip(mirror.last_update_started_at) : _('Never') |