Commit cc82ea99 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix repository ff_merge method

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent f6325757
......@@ -864,7 +864,7 @@ class Repository
raise 'Invalid merge target' if our_commit.nil?
raise 'Invalid merge source' if their_commit.nil?
Gitlab::Git::OperationService.new(user, raw_repository).with_branch(target_branch) do |start_commit|
with_branch(user, target_branch) do |start_commit|
merge_request&.update(in_progress_merge_commit_sha: their_commit.oid)
their_commit.oid
......
......@@ -38,6 +38,9 @@ describe MergeRequest do
end
describe '#rebase_in_progress?' do
# Create merge request and project before we stub file calls
before { subject }
it 'returns true when there is a current rebase directory' do
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:mtime).and_return(Time.now)
......@@ -69,6 +72,9 @@ describe MergeRequest do
end
describe '#squash_in_progress?' do
# Create merge request and project before we stub file calls
before { subject }
it 'returns true when there is a current squash directory' do
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:mtime).and_return(Time.now)
......
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