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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
945e4293
Commit
945e4293
authored
Nov 19, 2015
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent unnecessary forks iteration at parent update
parent
6f41e3d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
app/services/projects/update_service.rb
app/services/projects/update_service.rb
+5
-3
No files found.
app/services/projects/update_service.rb
View file @
945e4293
...
@@ -13,7 +13,7 @@ module Projects
...
@@ -13,7 +13,7 @@ module Projects
end
end
return
false
unless
visibility_level_allowed?
(
new_visibility
)
return
false
unless
visibility_level_allowed?
(
new_visibility
)
update_forks_visibility_level
(
new_visibility
)
update_forks_visibility_level
(
new_visibility
.
to_i
)
end
end
new_branch
=
params
[
:default_branch
]
new_branch
=
params
[
:default_branch
]
...
@@ -44,11 +44,13 @@ module Projects
...
@@ -44,11 +44,13 @@ module Projects
end
end
def
update_forks_visibility_level
(
new_level
)
def
update_forks_visibility_level
(
new_level
)
return
unless
new_level
<
project
.
visibility_level
project
.
forks
.
each
do
|
forked_project
|
project
.
forks
.
each
do
|
forked_project
|
fork_level
=
forked_project
.
visibility_level
fork_level
=
forked_project
.
visibility_level
if
fork_level
>
new_level
.
to_i
if
fork_level
>
new_level
forked_project
.
visibility_level
=
new_level
.
to_i
forked_project
.
visibility_level
=
new_level
forked_project
.
save!
forked_project
.
save!
end
end
end
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