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:
Diffstat (limited to 'app/controllers/projects/network_controller.rb')
-rw-r--r--app/controllers/projects/network_controller.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/projects/network_controller.rb b/app/controllers/projects/network_controller.rb
index 84ac9fb01fd..aa0838752e2 100644
--- a/app/controllers/projects/network_controller.rb
+++ b/app/controllers/projects/network_controller.rb
@@ -6,7 +6,7 @@ class Projects::NetworkController < Projects::ApplicationController
before_action :require_non_empty_project
before_action :assign_ref_vars
- before_action :authorize_download_code!
+ before_action :authorize_read_code!
before_action :assign_options
before_action :assign_commit
@@ -14,7 +14,13 @@ class Projects::NetworkController < Projects::ApplicationController
urgency :low, [:show]
def show
- @url = project_network_path(@project, @ref, @options.merge(format: :json))
+ @url = if Feature.enabled?(:use_ref_type_parameter, @project)
+ project_network_path(@project, @ref, @options.merge(format: :json, ref_type: ref_type))
+ else
+ project_network_path(@project, @ref, @options.merge(format: :json))
+ end
+
+ @ref_type = ref_type
@commit_url = project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")
respond_to do |format|