Commit f025ff65 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch...

Merge branch '331803-git-repo-by-url-import-no-longer-works-if-the-repo-doesn-t-end-in-git-revert-the-original' into 'master'

Revert "Enforce .git in the URL when importing Repo by URL"

See merge request gitlab-org/gitlab!62552
parents 3e8165c7 b6981d9b
......@@ -83,7 +83,7 @@
.js-toggle-content.toggle-import-form{ class: ('hide' if active_tab != 'import') }
= form_for @project, html: { class: 'new_project gl-show-field-errors' } do |f|
= form_for @project, html: { class: 'new_project' } do |f|
%hr
= render "shared/import_form", f: f
= render 'projects/new_project_fields', f: f, project_name_id: "import-url-name", hide_init_with_readme: true, track_label: track_label
......@@ -6,14 +6,8 @@
= f.label :import_url, class: 'label-bold' do
%span
= _('Git repository URL')
= f.text_field :import_url,
value: import_url.sanitized_url,
autocomplete: 'off',
class: 'form-control gl-form-input',
placeholder: 'https://gitlab.company.com/group/project.git',
required: true,
pattern: '(?:git|https?):\/\/.*/.*\.git$',
title: _('Please provide a valid URL ending with .git')
= f.text_field :import_url, value: import_url.sanitized_url,
autocomplete: 'off', class: 'form-control gl-form-input', placeholder: 'https://gitlab.company.com/group/project.git', required: true
.row
.form-group.col-md-6
......
......@@ -74,7 +74,7 @@ RSpec.describe 'New project', :js do
page.within '#import-project-pane' do
first('.js-import-git-toggle-button').click
fill_in 'project_import_url', with: 'http://foo/bar.git'
fill_in 'project_import_url', with: 'http://foo.git'
fill_in 'project_name', with: 'import-project-with-features1'
fill_in 'project_path', with: 'import-project-with-features1'
choose 'project_visibility_level_20'
......@@ -94,7 +94,7 @@ RSpec.describe 'New project', :js do
page.within '#ci-cd-project-pane' do
find('.js-import-git-toggle-button').click
fill_in 'project_import_url', with: 'http://foo/bar.git'
fill_in 'project_import_url', with: 'http://foo.git'
fill_in 'project_name', with: 'CI CD Project1'
fill_in 'project_path', with: 'ci-cd-project1'
choose 'project_visibility_level_20'
......
......@@ -24645,9 +24645,6 @@ msgstr ""
msgid "Please provide a valid URL"
msgstr ""
msgid "Please provide a valid URL ending with .git"
msgstr ""
msgid "Please provide a valid URL."
msgstr ""
......
......@@ -356,16 +356,6 @@ RSpec.describe 'New project', :js do
expect(git_import_instructions).to have_content 'Git repository URL'
end
it 'reports error if repo URL does not end with .git' do
fill_in 'project_import_url', with: 'http://foo/bar'
fill_in 'project_name', with: 'import-project-without-git-suffix'
fill_in 'project_path', with: 'import-project-without-git-suffix'
click_button 'Create project'
expect(page).to have_text('Please provide a valid URL ending with .git')
end
it 'keeps "Import project" tab open after form validation error' do
collision_project = create(:project, name: 'test-name-collision', namespace: user.namespace)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment