Skip to content
Snippets Groups Projects
Commit 9dfa6315 authored by James Lopez's avatar James Lopez
Browse files

Fix 500 error updating mirror URLs for projects

parent c86ef86c
No related branches found
No related tags found
No related merge requests found
Please view this file on the master branch, on stable branches it's out of date.
 
v 8.13.0 (unreleased)
- Fix 500 error updating mirror URLs for projects
 
v 8.12.4 (unreleased)
- [ES] Indexer works with smaller batches of repositories to not exceed NOFILE limit
Loading
Loading
Loading
Loading
@@ -527,7 +527,7 @@ class Project < ActiveRecord::Base
end
 
def import_url
if import_data && super
if import_data && super.present?
import_url = Gitlab::UrlSanitizer.new(super, credentials: import_data.credentials)
import_url.full_url
else
Loading
Loading
require 'spec_helper'
describe Projects::MirrorsController do
let(:project) do
create(:project,
mirror: true,
mirror_user: user,
import_url: 'http://user:pass@test.url')
end
let(:user) { create(:user) }
describe 'updates the mirror URL' do
before do
project.team << [user, :master]
login_as(user)
end
it 'complains about passing an empty URL' do
patch namespace_project_mirror_path(project.namespace, project),
project: {
mirror: '1',
import_url: '',
mirror_user_id: '1',
mirror_trigger_builds: '0'
}
expect(response).to have_http_status :success
expect(response).to render_template(:show)
expect(response.body).to include('Import url can&#39;t be blank')
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment