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
7ecaae69
Commit
7ecaae69
authored
Jul 17, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve conflicts in project update service
parent
be9efb63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
18 deletions
+15
-18
app/services/projects/update_service.rb
app/services/projects/update_service.rb
+15
-18
No files found.
app/services/projects/update_service.rb
View file @
7ecaae69
module
Projects
class
UpdateService
<
BaseService
def
execute
unless
visibility_level_allowed?
return
error
(
'New visibility level not allowed!'
)
end
<<<<<<<
HEAD
# Repository size limit comes as MB from the view
limit
=
params
.
delete
(
:repository_size_limit
)
project
.
repository_size_limit
=
Gitlab
::
Utils
.
try_megabytes_to_bytes
(
limit
)
if
limit
new_branch
=
params
.
delete
(
:default_branch
)
new_repository_storage
=
params
.
delete
(
:repository_storage
)
unless
visibility_level_allowed?
return
error
(
'New visibility level not allowed!'
)
end
if
project
.
repository
.
exists?
if
new_branch
&&
new_branch
!=
project
.
default_branch
project
.
change_head
(
new_branch
)
end
if
changing_storage_size?
project
.
change_repository_storage
(
params
.
delete
(
:repository_storage
))
end
if
new_repository_storage
&&
can?
(
current_user
,
:change_repository_storage
,
project
)
project
.
change_repository_storage
(
new_repository_storage
)
end
=======
if
project
.
has_container_registry_tags?
return
error
(
'Cannot rename project because it contains container registry tags!'
)
end
if
changing_default_branch?
project
.
change_head
(
params
[
:default_branch
])
>>>>>>>
ce
-
com
/
master
end
if
project
.
update_attributes
(
params
)
...
...
@@ -62,11 +52,18 @@ module Projects
true
end
def
changing_storage_size?
new_repository_storage
=
params
[
:repository_storage
]
new_repository_storage
&&
project
.
repository
.
exists?
&&
can?
(
current_user
,
:change_repository_storage
,
project
)
end
def
changing_default_branch?
new_branch
=
params
[
:default_branch
]
project
.
repository
.
exists?
&&
new_branch
&&
new_branch
!=
project
.
default_branch
new_branch
&&
project
.
repository
.
exists?
&&
new_branch
!=
project
.
default_branch
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