From 561e1b470f0a99fe6304c8f197348c47a637d594 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 2 Mar 2020 21:08:01 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/services/projects/update_service.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/services/projects/update_service.rb') diff --git a/app/services/projects/update_service.rb b/app/services/projects/update_service.rb index aedd7252f63..e10dede632a 100644 --- a/app/services/projects/update_service.rb +++ b/app/services/projects/update_service.rb @@ -13,6 +13,10 @@ module Projects ensure_wiki_exists if enabling_wiki? + if changing_storage_size? + project.change_repository_storage(params.delete(:repository_storage)) + end + yield if block_given? validate_classification_label(project, :external_authorization_classification_label) @@ -140,6 +144,13 @@ module Projects def changing_pages_https_only? project.previous_changes.include?(:pages_https_only) 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 end end -- cgit v1.2.1