From 22afa6177e5cdd2843502d425cb584135a35df60 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 29 Mar 2023 23:54:01 +0000 Subject: Add latest changes from gitlab-org/security/gitlab@15-9-stable-ee --- app/controllers/projects/tree_controller.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/controllers/projects/tree_controller.rb') diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index 737a6290431..1f7912e15df 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -28,6 +28,15 @@ class Projects::TreeController < Projects::ApplicationController def show return render_404 unless @commit + @ref_type = ref_type + if @ref_type == BRANCH_REF_TYPE && ambiguous_ref?(@project, @ref) + branch = @project.repository.find_branch(@ref) + if branch + redirect_to project_tree_path(@project, branch.target) + return + end + end + if tree.entries.empty? if @repository.blob_at(@commit.id, @path) redirect_to project_blob_path(@project, File.join(@ref, @path)) -- cgit v1.2.1 From 1794d7d6a11019da7fe8bb56536f3fce69d1825d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 29 Mar 2023 23:58:22 +0000 Subject: Add latest changes from gitlab-org/security/gitlab@15-9-stable-ee --- app/controllers/projects/tree_controller.rb | 9 --------- 1 file changed, 9 deletions(-) (limited to 'app/controllers/projects/tree_controller.rb') diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index 1f7912e15df..737a6290431 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -28,15 +28,6 @@ class Projects::TreeController < Projects::ApplicationController def show return render_404 unless @commit - @ref_type = ref_type - if @ref_type == BRANCH_REF_TYPE && ambiguous_ref?(@project, @ref) - branch = @project.repository.find_branch(@ref) - if branch - redirect_to project_tree_path(@project, branch.target) - return - end - end - if tree.entries.empty? if @repository.blob_at(@commit.id, @path) redirect_to project_blob_path(@project, File.join(@ref, @path)) -- cgit v1.2.1 From d6192c2ab77ab814b9bd66103663047556fd67e4 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 30 Mar 2023 13:38:24 +0000 Subject: Add latest changes from gitlab-org/security/gitlab@15-9-stable-ee --- app/controllers/projects/tree_controller.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/controllers/projects/tree_controller.rb') diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index 737a6290431..1f7912e15df 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -28,6 +28,15 @@ class Projects::TreeController < Projects::ApplicationController def show return render_404 unless @commit + @ref_type = ref_type + if @ref_type == BRANCH_REF_TYPE && ambiguous_ref?(@project, @ref) + branch = @project.repository.find_branch(@ref) + if branch + redirect_to project_tree_path(@project, branch.target) + return + end + end + if tree.entries.empty? if @repository.blob_at(@commit.id, @path) redirect_to project_blob_path(@project, File.join(@ref, @path)) -- cgit v1.2.1