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
18db9f61
Commit
18db9f61
authored
Apr 18, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored fix for import_url mirror check
parent
df490964
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
app/models/project.rb
app/models/project.rb
+6
-3
No files found.
app/models/project.rb
View file @
18db9f61
...
...
@@ -91,7 +91,7 @@ class Project < ActiveRecord::Base
after_update
:update_forks_visibility_level
after_update
:remove_mirror_repository_reference
,
if:
->
(
project
)
{
project
.
mirror?
&&
project
.
import_url_
chang
ed?
}
if:
->
(
project
)
{
project
.
mirror?
&&
project
.
import_url_
updat
ed?
}
ActsAsTaggableOn
.
strict_case_match
=
true
acts_as_taggable_on
:tags
...
...
@@ -1250,6 +1250,11 @@ class Project < ActiveRecord::Base
self
.
merge_requests_ff_only_enabled
||
self
.
merge_requests_rebase_enabled
end
def
import_url_updated?
# check if import_url has been updated and it's not just the first assignment
import_url_changed?
&&
changes
[
'import_url'
].
first
end
private
def
update_forks_visibility_level
...
...
@@ -1264,8 +1269,6 @@ class Project < ActiveRecord::Base
end
def
remove_mirror_repository_reference
# return if it's the first assignment
return
unless
changes
[
'import_url'
]
&&
changes
[
'import_url'
].
first
repository
.
remove_remote
(
Repository
::
MIRROR_REMOTE
)
end
...
...
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