diff options
6 files changed, 10 insertions, 10 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js index 69bc1436284..d4ef5972ce0 100644 --- a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js +++ b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js @@ -47,7 +47,7 @@ export default class MergeRequestStore { this.sourceBranchPath = data.source_branch_path; this.sourceBranchLink = data.source_branch_with_namespace_link; this.mergeError = data.merge_error; - this.targetBranchPath = data.target_branch_commits_path; + this.targetBranchPath = data.target_branch_tree_path; this.conflictResolutionPath = data.conflict_resolution_path; this.cancelAutoMergePath = data.cancel_merge_when_pipeline_succeeds_path; this.removeWIPPath = data.remove_wip_path; diff --git a/app/presenters/merge_request_presenter.rb b/app/presenters/merge_request_presenter.rb index 101568b66b7..4084a982071 100644 --- a/app/presenters/merge_request_presenter.rb +++ b/app/presenters/merge_request_presenter.rb @@ -76,9 +76,9 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated end end - def target_branch_commits_path + def target_branch_tree_path if target_branch_exists? - project_commits_path(project, target_branch) + project_tree_path(project, target_branch) end end diff --git a/app/serializers/merge_request_entity.rb b/app/serializers/merge_request_entity.rb index 7ec2dbd0efe..fb6709699a7 100644 --- a/app/serializers/merge_request_entity.rb +++ b/app/serializers/merge_request_entity.rb @@ -93,8 +93,8 @@ class MergeRequestEntity < IssuableEntity # Paths # - expose :target_branch_commits_path do |merge_request| - presenter(merge_request).target_branch_commits_path + expose :target_branch_tree_path do |merge_request| + presenter(merge_request).target_branch_tree_path end expose :new_blob_path do |merge_request| diff --git a/spec/fixtures/api/schemas/entities/merge_request.json b/spec/fixtures/api/schemas/entities/merge_request.json index b6a59a6cc47..b6cda963ffa 100644 --- a/spec/fixtures/api/schemas/entities/merge_request.json +++ b/spec/fixtures/api/schemas/entities/merge_request.json @@ -74,7 +74,7 @@ }, "additionalProperties": false }, - "target_branch_commits_path": { "type": "string" }, + "target_branch_tree_path": { "type": "string" }, "source_branch_path": { "type": "string" }, "conflict_resolution_path": { "type": ["string", "null"] }, "cancel_merge_when_pipeline_succeeds_path": { "type": "string" }, diff --git a/spec/presenters/merge_request_presenter_spec.rb b/spec/presenters/merge_request_presenter_spec.rb index 40fe9e3c004..ef12611cff8 100644 --- a/spec/presenters/merge_request_presenter_spec.rb +++ b/spec/presenters/merge_request_presenter_spec.rb @@ -317,10 +317,10 @@ describe MergeRequestPresenter do end end - describe '#target_branch_commits_path' do + describe '#target_branch_tree_path' do subject do described_class.new(resource, current_user: user) - .target_branch_commits_path + .target_branch_tree_path end context 'when target branch exists' do @@ -328,7 +328,7 @@ describe MergeRequestPresenter do allow(resource).to receive(:target_branch_exists?) { true } is_expected - .to eq("/#{resource.target_project.full_path}/commits/#{resource.target_branch}") + .to eq("/#{resource.target_project.full_path}/tree/#{resource.target_branch}") end end diff --git a/spec/serializers/merge_request_entity_spec.rb b/spec/serializers/merge_request_entity_spec.rb index d38433c2365..0c1db82aa55 100644 --- a/spec/serializers/merge_request_entity_spec.rb +++ b/spec/serializers/merge_request_entity_spec.rb @@ -46,7 +46,7 @@ describe MergeRequestEntity do :conflict_resolution_path, :cancel_merge_when_pipeline_succeeds_path, :create_issue_to_resolve_discussions_path, - :source_branch_path, :target_branch_commits_path, + :source_branch_path, :target_branch_tree_path, :commits_count) end |