diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-05-04 17:06:01 -0700 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-05-05 12:12:50 -0700 |
commit | f05469f99b8c52c4dab7ac9160b47676c87124f9 (patch) | |
tree | 89d39b3c7672d89fd05346c2ea930ae039a95c4a /app/controllers/projects/application_controller.rb | |
parent | 9e48f02ea802814e4df1f1de5ed509942dca7581 (diff) | |
download | gitlab-ce-f05469f99b8c52c4dab7ac9160b47676c87124f9.tar.gz |
Resolve discussions
Diffstat (limited to 'app/controllers/projects/application_controller.rb')
-rw-r--r-- | app/controllers/projects/application_controller.rb | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb index 2301e1cca77..25232fc9457 100644 --- a/app/controllers/projects/application_controller.rb +++ b/app/controllers/projects/application_controller.rb @@ -17,24 +17,17 @@ class Projects::ApplicationController < ApplicationController # to # localhost/group/project # - if params[:format] == 'git' - redirect_to request.original_url.gsub(/\.git\/?\Z/, '') - return - end + redirect_to url_for(params.merge(format: nil)) if params[:format] == 'git' end def project - @project ||= find_routable!(Project, requested_full_path, extra_authorization_method: :project_not_being_deleted?) - end - - def requested_full_path - namespace = params[:namespace_id] - id = params[:project_id] || params[:id] - "#{namespace}/#{id}" + @project ||= find_routable!(Project, + File.join(params[:namespace_id], params[:project_id] || params[:id]), + extra_authorization_proc: project_not_being_deleted?) end - def project_not_being_deleted?(project) - !project.pending_delete? + def project_not_being_deleted? + ->(project) { !project.pending_delete? } end def repository |