diff options
author | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2023-03-30 21:08:43 +0000 |
---|---|---|
committer | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2023-03-30 21:08:43 +0000 |
commit | 125e519c15ece1361000fcdb8379cb40329b33fd (patch) | |
tree | 78253d9abc4a68b07c0013e4d8448f0104cd199d /app/controllers/projects_controller.rb | |
parent | b405157ce7809b3671155faa8f3c3395e3fc74ce (diff) | |
parent | d6192c2ab77ab814b9bd66103663047556fd67e4 (diff) | |
download | gitlab-ce-125e519c15ece1361000fcdb8379cb40329b33fd.tar.gz |
Merge remote-tracking branch 'dev/15-9-stable' into 15-9-stable
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 71ad747b6b1..d71b782c62b 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -171,11 +171,19 @@ class ProjectsController < Projects::ApplicationController flash.now[:alert] = _("Project '%{project_name}' queued for deletion.") % { project_name: @project.name } end + if ambiguous_ref?(@project, @ref) + branch = @project.repository.find_branch(@ref) + + # The files view would render a ref other than the default branch + # This redirect can be removed once the view is fixed + redirect_to(project_tree_path(@project, branch.target), alert: _("The default branch of this project clashes with another ref")) + return + end + respond_to do |format| format.html do @notification_setting = current_user.notification_settings_for(@project) if current_user @project = @project.present(current_user: current_user) - render_landing_page end |