Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-21 21:06:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-21 21:06:29 +0300
commitf1bb2a307e9b125a8ee0be3728cb0d1baa21a3d4 (patch)
tree154817af5e3f1b134be08ef22d1926edf87ab74f /app/controllers/projects/blame_controller.rb
parentad1e4b8fb8104b642fa79ed34fd144bc2bed8a19 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/projects/blame_controller.rb')
-rw-r--r--app/controllers/projects/blame_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/projects/blame_controller.rb b/app/controllers/projects/blame_controller.rb
index 9076bdb9f04..92655d593dd 100644
--- a/app/controllers/projects/blame_controller.rb
+++ b/app/controllers/projects/blame_controller.rb
@@ -3,6 +3,7 @@
# Controller for viewing a file's blame
class Projects::BlameController < Projects::ApplicationController
include ExtractsPath
+ include RedirectsForMissingPathOnTree
before_action :require_non_empty_project
before_action :assign_ref_vars
@@ -11,7 +12,9 @@ class Projects::BlameController < Projects::ApplicationController
def show
@blob = @repository.blob_at(@commit.id, @path)
- return render_404 unless @blob
+ unless @blob
+ return redirect_to_tree_root_for_missing_path(@project, @ref, @path)
+ end
environment_params = @repository.branch_exists?(@ref) ? { ref: @ref } : { commit: @commit }
@environment = EnvironmentsFinder.new(@project, current_user, environment_params).execute.last