Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3c9b4da8
Commit
3c9b4da8
authored
Jan 29, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow project to be set up to push to and pull from same mirror
parent
ff0fafe3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
16 deletions
+5
-16
changelogs/unreleased-ee/dm-remote-mirror-url-availability.yml
...elogs/unreleased-ee/dm-remote-mirror-url-availability.yml
+5
-0
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+0
-6
ee/app/models/remote_mirror.rb
ee/app/models/remote_mirror.rb
+0
-10
No files found.
changelogs/unreleased-ee/dm-remote-mirror-url-availability.yml
0 → 100644
View file @
3c9b4da8
---
title
:
Allow project to be set up to push to and pull from same mirror
merge_request
:
author
:
type
:
fixed
ee/app/models/ee/project.rb
View file @
3c9b4da8
...
@@ -334,12 +334,6 @@ module EE
...
@@ -334,12 +334,6 @@ module EE
repository
.
async_remove_remote
(
::
Repository
::
MIRROR_REMOTE
)
repository
.
async_remove_remote
(
::
Repository
::
MIRROR_REMOTE
)
end
end
def
import_url_availability
if
remote_mirrors
.
find_by
(
url:
import_url
)
errors
.
add
(
:import_url
,
'is already in use by a remote mirror'
)
end
end
def
username_only_import_url
def
username_only_import_url
bare_url
=
read_attribute
(
:import_url
)
bare_url
=
read_attribute
(
:import_url
)
return
bare_url
unless
::
Gitlab
::
UrlSanitizer
.
valid?
(
bare_url
)
return
bare_url
unless
::
Gitlab
::
UrlSanitizer
.
valid?
(
bare_url
)
...
...
ee/app/models/remote_mirror.rb
View file @
3c9b4da8
...
@@ -17,8 +17,6 @@ class RemoteMirror < ActiveRecord::Base
...
@@ -17,8 +17,6 @@ class RemoteMirror < ActiveRecord::Base
belongs_to
:project
,
inverse_of: :remote_mirrors
belongs_to
:project
,
inverse_of: :remote_mirrors
validates
:url
,
presence:
true
,
url:
{
protocols:
%w(ssh git http https)
,
allow_blank:
true
}
validates
:url
,
presence:
true
,
url:
{
protocols:
%w(ssh git http https)
,
allow_blank:
true
}
validate
:url_availability
,
if:
->
(
mirror
)
{
mirror
.
url_changed?
||
mirror
.
enabled?
}
validates
:url
,
addressable_url:
true
,
if: :url_changed?
validates
:url
,
addressable_url:
true
,
if: :url_changed?
before_save
:set_new_remote_name
,
if: :mirror_url_changed?
before_save
:set_new_remote_name
,
if: :mirror_url_changed?
...
@@ -174,14 +172,6 @@ class RemoteMirror < ActiveRecord::Base
...
@@ -174,14 +172,6 @@ class RemoteMirror < ActiveRecord::Base
end
end
end
end
def
url_availability
return
unless
project
if
project
.
import_url
==
url
&&
project
.
mirror?
errors
.
add
(
:url
,
'is already in use'
)
end
end
def
reset_fields
def
reset_fields
update_columns
(
update_columns
(
last_error:
nil
,
last_error:
nil
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment