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/tree_controller.rb
parentad1e4b8fb8104b642fa79ed34fd144bc2bed8a19 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/projects/tree_controller.rb')
-rw-r--r--app/controllers/projects/tree_controller.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb
index 7509cc29a76..eec89afe354 100644
--- a/app/controllers/projects/tree_controller.rb
+++ b/app/controllers/projects/tree_controller.rb
@@ -5,6 +5,7 @@ class Projects::TreeController < Projects::ApplicationController
include ExtractsPath
include CreatesCommit
include ActionView::Helpers::SanitizeHelper
+ include RedirectsForMissingPathOnTree
around_action :allow_gitaly_ref_name_caching, only: [:show]
@@ -19,12 +20,9 @@ class Projects::TreeController < Projects::ApplicationController
if tree.entries.empty?
if @repository.blob_at(@commit.id, @path)
- return redirect_to(
- project_blob_path(@project,
- File.join(@ref, @path))
- )
+ return redirect_to project_blob_path(@project, File.join(@ref, @path))
elsif @path.present?
- return render_404
+ return redirect_to_tree_root_for_missing_path(@project, @ref, @path)
end
end