diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-18 16:14:12 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-18 16:14:12 +0100 |
commit | f4f4a6b5303a0889f3fdb1bfe0bb014a6788c4d6 (patch) | |
tree | 5db5d07a749d974d1afeb5050a9157112a1d687b /app/controllers | |
parent | 0ac57a540d245a24219519c4093d15b8ab2f536c (diff) | |
download | gitlab-ce-f4f4a6b5303a0889f3fdb1bfe0bb014a6788c4d6.tar.gz |
Fix specs and behavior for LFS files
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/forks_controller.rb | 11 | ||||
-rw-r--r-- | app/controllers/projects/imports_controller.rb | 9 | ||||
-rw-r--r-- | app/controllers/projects/tree_controller.rb | 2 |
3 files changed, 15 insertions, 7 deletions
diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb index 51181b8042e..1d599b6c427 100644 --- a/app/controllers/projects/forks_controller.rb +++ b/app/controllers/projects/forks_controller.rb @@ -13,15 +13,13 @@ class Projects::ForksController < Projects::ApplicationController @forked_project = ::Projects::ForkService.new(project, current_user, namespace: namespace).execute if @forked_project.saved? && @forked_project.forked? - continue_params[:notice] ||= "The project was successfully forked." - if @forked_project.import_in_progress? redirect_to namespace_project_import_path(@forked_project.namespace, @forked_project, continue: continue_params) else if continue_params redirect_to continue_params[:to], notice: continue_params[:notice] else - redirect_to namespace_project_path(@forked_project.namespace, @forked_project) + redirect_to namespace_project_path(@forked_project.namespace, @forked_project), notice: "The project was successfully forked." end end else @@ -32,6 +30,11 @@ class Projects::ForksController < Projects::ApplicationController private def continue_params - params[:continue].permit(:to, :notice, :notice_now) + continue_params = params[:continue] + if continue_params + continue_params.permit(:to, :notice, :notice_now) + else + nil + end end end diff --git a/app/controllers/projects/imports_controller.rb b/app/controllers/projects/imports_controller.rb index e9c9edd3a3c..8d8035ef5ff 100644 --- a/app/controllers/projects/imports_controller.rb +++ b/app/controllers/projects/imports_controller.rb @@ -28,7 +28,7 @@ class Projects::ImportsController < Projects::ApplicationController if continue_params redirect_to continue_params[:to], notice: continue_params[:notice] else - redirect_to project_path(@project) + redirect_to project_path(@project), notice: "The project was successfully forked." end elsif @project.import_failed? redirect_to new_namespace_project_import_path(@project.namespace, @project) @@ -43,7 +43,12 @@ class Projects::ImportsController < Projects::ApplicationController private def continue_params - @continue_params ||= params[:continue].permit(:to, :notice, :notice_now) + continue_params = params[:continue] + if continue_params + continue_params.permit(:to, :notice, :notice_now) + else + nil + end end def require_no_repo diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index 4f78bde2d2d..cb3ed0f6f9c 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -35,7 +35,7 @@ class Projects::TreeController < Projects::ApplicationController return render_404 unless @commit_params.values.all? create_commit(Files::CreateDirService, success_notice: "The directory has been successfully created.", - success_path: namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, @dir_name)), + success_path: namespace_project_tree_path(@project.namespace, @project, File.join(@target_branch, @dir_name)), failure_path: namespace_project_tree_path(@project.namespace, @project, @ref)) end |