Commit e9955331 authored by Douwe Maan's avatar Douwe Maan

Fix EE for new diff notes

parent 7927695b
......@@ -679,12 +679,8 @@ class MergeRequest < ActiveRecord::Base
end
end
def source_sha_parent
source_project.repository.commit(first_commit.sha).parents.first.sha
end
def ff_merge_possible?
project.repository.is_ancestor?(target_sha, source_sha)
project.repository.is_ancestor?(target_branch_sha, diff_head_sha)
end
def should_be_rebased?
......
......@@ -9,7 +9,7 @@ module MergeRequests
private
def commit
repository.ff_merge(current_user, merge_request.source_sha, merge_request.target_branch)
repository.ff_merge(current_user, merge_request.diff_head_sha, merge_request.target_branch)
end
end
end
......@@ -54,14 +54,14 @@ class Spinach::Features::ProjectFfMergeRequests < Spinach::FeatureSteps
step 'merge request "Bug NS-05" is rebased' do
merge_request.source_branch = 'flatten-dir'
merge_request.target_branch = 'improve/awesome'
merge_request.reload_code
merge_request.reload_diff
merge_request.save!
end
step 'merge request "Bug NS-05" merged target' do
merge_request.source_branch = 'merged-target'
merge_request.target_branch = 'improve/awesome'
merge_request.reload_code
merge_request.reload_diff
merge_request.save!
end
......
......@@ -335,12 +335,6 @@ describe MergeRequest, models: true do
end
end
describe "#source_sha_parent" do
it "returns the sha of the parent commit of the first commit in the MR" do
expect(subject.source_sha_parent).to eq("ae73cb07c9eeaf35924a10f713b364d32b2dd34f")
end
end
describe '#diverged_commits_count' do
let(:project) { create(:project) }
let(:fork_project) { create(:project, forked_from_project: project) }
......
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