Commit e2b253dd authored by Rémy Coutable's avatar Rémy Coutable

Resolve controllers, helpers, presenters & serializers conflicts

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 0f335323
......@@ -83,13 +83,8 @@ class Projects::BranchesController < Projects::ApplicationController
redirect_to namespace_project_branches_path(@project.namespace, @project), status: 303
end
<<<<<<< HEAD
format.js { render nothing: true, status: status[:return_code] }
format.json { render json: { message: status[:message] }, status: status[:return_code] }
=======
format.js { render nothing: true, status: result[:return_code] }
format.json { render json: { message: result[:message] }, status: result[:return_code] }
>>>>>>> upstream/master
end
end
......
......@@ -60,7 +60,6 @@ module MergeRequestsHelper
)
end
<<<<<<< HEAD
def render_items_list(items, separator = "and")
items_cnt = items.size
......@@ -100,8 +99,6 @@ module MergeRequestsHelper
str
end
=======
>>>>>>> upstream/master
def format_mr_branch_names(merge_request)
source_path = merge_request.source_project_path
target_path = merge_request.target_project_path
......
......@@ -184,11 +184,9 @@ class Project < ActiveRecord::Base
has_many :remote_mirrors, inverse_of: :project, dependent: :destroy
has_many :environments, dependent: :destroy
has_many :deployments, dependent: :destroy
<<<<<<< HEAD
has_many :path_locks, dependent: :destroy
=======
has_many :pipeline_schedules, dependent: :destroy, class_name: 'Ci::PipelineSchedule'
>>>>>>> upstream/master
has_many :path_locks, dependent: :destroy
has_many :active_runners, -> { active }, through: :runner_projects, source: :runner, class_name: 'Ci::Runner'
......
......@@ -81,7 +81,6 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end
end
<<<<<<< HEAD
def rebase_path
if !rebase_in_progress? && should_be_rebased? && user_can_push_to_source_branch?
rebase_namespace_project_merge_request_path(project.namespace,
......@@ -90,8 +89,6 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end
end
=======
>>>>>>> upstream/master
def target_branch_commits_path
if target_branch_exists?
namespace_project_commits_path(project.namespace, project, target_branch)
......@@ -104,7 +101,6 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end
end
<<<<<<< HEAD
def approvals_path
if requires_approve?
approvals_namespace_project_merge_request_path(project.namespace,
......@@ -113,8 +109,6 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end
end
=======
>>>>>>> upstream/master
def source_branch_with_namespace_link
namespace = source_project_namespace
branch = source_branch
......@@ -161,13 +155,10 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
user_can_collaborate_with_project? && can_be_cherry_picked?
end
<<<<<<< HEAD
def can_push_to_source_branch?
source_branch_exists? && user_can_push_to_source_branch?
end
=======
>>>>>>> upstream/master
private
def closing_issues
......@@ -186,15 +177,12 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end.sort.to_sentence
end
<<<<<<< HEAD
def user_can_push_to_source_branch?
::Gitlab::UserAccess
.new(current_user, project: source_project)
.can_push_to_branch?(source_branch)
end
=======
>>>>>>> upstream/master
def user_can_collaborate_with_project?
can?(current_user, :push_code, project) ||
(current_user && current_user.already_forked?(project))
......
......@@ -30,13 +30,8 @@ class EnvironmentEntity < Grape::Entity
environment)
end
<<<<<<< HEAD
expose :terminal_path, if: ->(environment, _) { environment.deployment_service_ready? } do |environment|
can?(request.user, :admin_environment, environment.project) &&
=======
expose :terminal_path, if: ->(environment, _) { environment.has_terminals? } do |environment|
can?(request.current_user, :admin_environment, environment.project) &&
>>>>>>> upstream/master
terminal_namespace_project_environment_path(
environment.project.namespace,
environment.project,
......
......@@ -7,8 +7,5 @@ class MergeRequestBasicEntity < Grape::Entity
expose :total_time_spent
expose :human_time_estimate
expose :human_total_time_spent
<<<<<<< HEAD
expose :rebase_in_progress?, as: :rebase_in_progress
=======
>>>>>>> upstream/master
end
class MergeRequestEntity < IssuableEntity
<<<<<<< HEAD
expose :approvals_before_merge
=======
include RequestAwareEntity
>>>>>>> upstream/master
expose :assignee_id
include RequestAwareEntity
......@@ -21,7 +15,6 @@ class MergeRequestEntity < IssuableEntity
expose :target_branch
expose :target_project_id
<<<<<<< HEAD
# EE-specific
expose :approvals_before_merge
expose :squash
......@@ -42,8 +35,6 @@ class MergeRequestEntity < IssuableEntity
presenter(merge_request).approvals_path
end
=======
>>>>>>> upstream/master
# Events
expose :merge_event, using: EventEntity
expose :closed_event, using: EventEntity
......
......@@ -2,11 +2,7 @@ module Ci
class CreatePipelineService < BaseService
attr_reader :pipeline
<<<<<<< HEAD
def execute(ignore_skip_ci: false, save_on_errors: true, trigger_request: nil, mirror_update: false)
=======
def execute(ignore_skip_ci: false, save_on_errors: true, trigger_request: nil, schedule: nil)
>>>>>>> upstream/master
def execute(ignore_skip_ci: false, save_on_errors: true, trigger_request: nil, schedule: nil, mirror_update: false)
@pipeline = Ci::Pipeline.new(
project: project,
ref: ref,
......
......@@ -59,7 +59,6 @@ describe Projects::MergeRequestsController do
end
end
<<<<<<< HEAD
describe 'POST #create' do
def create_merge_request(overrides = {})
params = {
......@@ -223,8 +222,6 @@ describe Projects::MergeRequestsController do
end
end
=======
>>>>>>> upstream/master
describe 'GET commit_change_content' do
it 'renders commit_change_content template' do
get :commit_change_content,
......@@ -560,10 +557,7 @@ describe Projects::MergeRequestsController do
namespace_id: project.namespace,
project_id: project,
id: merge_request.iid,
<<<<<<< HEAD
squash: false,
=======
>>>>>>> upstream/master
format: 'json'
}
end
......
......@@ -40,7 +40,6 @@ describe MergeRequestsHelper do
it { is_expected.to eq([source_title, target_title]) }
end
end
<<<<<<< HEAD
describe '#render_items_list' do
it "returns one item in the list" do
......@@ -55,6 +54,4 @@ describe MergeRequestsHelper do
expect(render_items_list(%w(user user1 user2))).to eq("user, user1 and user2")
end
end
=======
>>>>>>> upstream/master
end
......@@ -353,7 +353,6 @@ describe MergeRequestPresenter do
end
end
end
<<<<<<< HEAD
describe '#can_push_to_source_branch' do
before do
......@@ -482,6 +481,4 @@ describe MergeRequestPresenter do
end
end
end
=======
>>>>>>> upstream/master
end
......@@ -47,16 +47,12 @@ describe MergeRequestEntity do
:cancel_merge_when_pipeline_succeeds_path,
:create_issue_to_resolve_discussions_path,
:source_branch_path, :target_branch_commits_path,
<<<<<<< HEAD
:commits_count,
## EE
:can_push_to_source_branch, :approvals_before_merge,
:squash, :rebase_commit_sha, :rebase_in_progress,
:approved, :should_be_rebased, :rebase_path,
:approvals_path, :ff_only_enabled)
=======
:commits_count)
>>>>>>> upstream/master
end
it 'has email_patches_path' do
......
......@@ -113,11 +113,7 @@ describe PipelineSerializer do
it "verifies number of queries" do
recorded = ActiveRecord::QueryRecorder.new { subject }
<<<<<<< HEAD
expect(recorded.count).to be_within(1).of(61)
=======
expect(recorded.count).to be_within(1).of(58)
>>>>>>> upstream/master
expect(recorded.cached_count).to eq(0)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment