Commit 6af30c73 authored by Valery Sizov's avatar Valery Sizov

Fix Rebasing not working with Merge Requests

parent 248ddf26
......@@ -49,7 +49,11 @@ module MergeRequests
end
def git_env
{ 'GL_ID' => Gitlab::GlId.gl_id(current_user), 'GL_PROTOCOL' => 'web' }
{
'GL_ID' => Gitlab::GlId.gl_id(current_user),
'GL_PROTOCOL' => 'web',
'GL_REPOSITORY'=> Gitlab::GlRepository.gl_repository(project, false),
}
end
# Don't try to print expensive instance variables.
......
---
title: Fix Rebasing not working with Merge Requests
merge_request:
author:
......@@ -40,6 +40,21 @@ describe MergeRequests::RebaseService do
expect(head_commit.committer_email).to eq(user.email)
expect(head_commit.committer_name).to eq(user.name)
end
context 'git commands' do
let(:service) { described_class.new(project, user, {}) }
it 'sets GL_REPOSITORY env variable when calling git commands' do
expect_any_instance_of(described_class)
.to receive(:run_git_command).exactly(4).with(
anything,
anything,
hash_including('GL_REPOSITORY'),
anything)
service.execute(merge_request)
end
end
end
end
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