diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-17 15:09:22 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-17 15:09:22 +0000 |
commit | 99f4b14cb0546a905d8f14f938d679d17e569005 (patch) | |
tree | d0520a58f46c8b5ceb018ca4d404e9a682f4af3c /app/controllers/projects/blob_controller.rb | |
parent | 4f8983ade80c0d71d4c8e6cc0d686c9cecf5e7d4 (diff) | |
download | gitlab-ce-99f4b14cb0546a905d8f14f938d679d17e569005.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/projects/blob_controller.rb')
-rw-r--r-- | app/controllers/projects/blob_controller.rb | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 59cea00e26b..a930cb458a1 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -53,10 +53,13 @@ class Projects::BlobController < Projects::ApplicationController end def create - create_commit(Files::CreateService, success_notice: _("The file has been successfully created."), - success_path: -> { project_blob_path(@project, File.join(@branch_name, @file_path)) }, - failure_view: :new, - failure_path: project_new_blob_path(@project, @ref)) + create_commit( + Files::CreateService, + success_notice: _("The file has been successfully created."), + success_path: -> { project_blob_path(@project, File.join(@branch_name, @file_path)) }, + failure_view: :new, + failure_path: project_new_blob_path(@project, @ref) + ) end def show @@ -86,9 +89,11 @@ class Projects::BlobController < Projects::ApplicationController def update @path = params[:file_path] if params[:file_path].present? - create_commit(Files::UpdateService, success_path: -> { after_edit_path }, - failure_view: :edit, - failure_path: project_blob_path(@project, @id)) + create_commit( + Files::UpdateService, success_path: -> { after_edit_path }, + failure_view: :edit, + failure_path: project_blob_path(@project, @id) + ) rescue Files::UpdateService::FileChangedError @conflict = true render :edit @@ -106,9 +111,12 @@ class Projects::BlobController < Projects::ApplicationController end def destroy - create_commit(Files::DeleteService, success_notice: _("The file has been successfully deleted."), - success_path: -> { after_delete_path }, - failure_path: project_blob_path(@project, @id)) + create_commit( + Files::DeleteService, + success_notice: _("The file has been successfully deleted."), + success_path: -> { after_delete_path }, + failure_path: project_blob_path(@project, @id) + ) end def diff |